4 Replies Latest reply on Dec 4, 2015 12:37 AM by markusf19722289

    Can i call shortcuts or a aip plugin directly from vbscript?

    markusf19722289

      I have a plugin which is located in the edit menu and i assigned a shortcut to it. Now i want to call it from another vb program but I didn't find anything in the "scripting guide" or in the "Scripting Reference VBScript.

        • 1. Re: Can i call shortcuts or a aip plugin directly from vbscript?
          LeoTaro Level 4

          I don't think you can call your plugin using the menu item.

           

          You could do a hacky workaround by doing something in your VB code that causes a plugin message to be sent to your aip plugin. Some examples off the top of my head:

           

          1. Register a file format in your aip plugin with a unique extension, e.g. .qztyz. There is a flag to stop it being shown in the GUI. In your VB code call Application.Open("tmp.qztyz"). You will get an AIFileFormatMessage to your aip plugin and you just return an error code (you may actually have to create a dummy file for the message to be sent to the plugin). Main problem is some third party plugins say they can open any file by returning kNoErr to every kSelectorAICheckFileFormat message, so the user can get a popup asking them which plugin to use.

           

          2. Set a unique preference in your VB code. Unfortunately there is no notifier for preference changes so you would have to combine this with the VB code making other changes that have notifiers, e.g. changing art, or have a timer in the aip code that continually checks the preference (yuk!).

           

          Hopefully this will give you something to work on.

          • 2. Re: Can i call shortcuts or a aip plugin directly from vbscript?
            markusf19722289 Level 1

            Thanks for the answer LeoTaro, but I'm really looking for a good and stable solution instead of some hack. I've already reached to start Illustrator, opening the file, activating the Illustrator app by AppActivate(...) and sending the key shortcuts by UiAutomation / SendKeys which actually works.

             

            My question is more like: Is there really no official way or solution invoking a recognized plugin by the com api? Can't image but also can't find anything. Perhaps some Illustrator developer can give a short help or answer/statement.

            • 3. Re: Can i call shortcuts or a aip plugin directly from vbscript?
              LeoTaro Level 4

              Unfortunately, due to the api limitations you sometimes have to revert to workarounds / hacks.

               

              There are ways of messaging one aip plugin from another aip plugin using the SDK API. I don't know of any way from the com API, but I haven't used it much.

               

              I can't remember the last time anyone from Adobe posted on this forum.

              • 4. Re: Can i call shortcuts or a aip plugin directly from vbscript?
                markusf19722289 Level 1

                It's a shame that adobe doesn't care much about the developer forum but therefore very pleasing that you answered. Thanks again. Looks like I have to use the workaround and evtl. I'll take another look into the SDK for the messaging workaround.

                 

                And if anyone from Adobe will read this, I will let all our customers know and we have a lot of designer from different companys that adobe doesn't care much about developer, api and automatisms . They really should consider this fact when deciding which design program to use!