7 Replies Latest reply on Apr 6, 2010 7:23 PM by JETalmage-71mYin

    Illy CS3 Automating a Script

    $Alphadog Level 1

      This probably sounds redundant

      over and over again , automating a script, but is there a way of assign

      ing a keyboard shortcut

      or run the

      script in an action?  I use mucho a script written and generously shared by JET to joinnearest points.  It's a pain to have to click on file and then scripts and then select the script each time.   I would like to eliminate 2 clicks (or mashes as they say in the southern states).  Is there a way to do this within the script (adding a lline)?

       

      Guidance will be appreciated.

        • 1. Re: Illy CS3 Automating a Script
          $Alphadog Level 1

          Yes Greg, the JET script can be run

          from an Action.  However it is not a recordable event. There is a command in the action menu to insert a non-recordable menu item.  Use that and all will be well.

           

          Thanks for asking the question.  There are a few people that wonder about this, both here and on the scripting site.

           

          Best of luck, Greg

          • 2. Re: Illy CS3 Automating a Script
            MHPhillips Level 1

            $Alphadog wrote:

             

            Yes Greg, the JET script can be run

            from an Action.  However it is not a recordable event. There is a command in the action menu to insert a non-recordable menu item.  Use that and all will be well.

             

            But doesn't the menu item disappear from the action when Illustrator is relaunched?

             

            MHP

            • 3. Re: Illy CS3 Automating a Script
              Mike Sofa Level 2

              The script can be assigned to an action, but the script step  will be "forgotten" by the action every time Illustrator is restarted.

              This Action-Script bug has been present for several versions, at least, and has never been fixed despite repeated pleas in the "Feature Request" forum. In CS4, this same bug has been expanded to the new Layer steps in actions.

              One workaround is to delete and reload Action Sets whenever Illustrator is launched.

              • 4. Re: Illy CS3 Automating a Script
                $Alphadog Level 1

                MH, yes it is lost when rebooting.  I had not restarted Illy.

                 

                Mike thanks, of course you are quite right, but in my case the workaround is still better that having to run the script from the file menu each time.  It is a simple action.

                • 5. Re: Illy CS3 Automating a Script
                  JETalmage Level 6
                  This Action-Script bug has been present for several versions, at least

                   

                  Correct. I have been complaining about this bug for four versions now.

                   

                  It has become my practice to do this:

                   

                  I keep an Action defined in my Actions palette named JET_CurrentScript. When it becomes clear to me that I will be repeatedly using a script in a work session, I go ahead and use InsertMenuItem to insert the step in that Action.

                   

                  This is not a fix or even a workaround. It just lessens the tedium in certain circumstances. It becomes just as tedious, of course, if you have to do that for multiple frequently-needed scripts with every launch (you know--like having to reset your palette settings in Swatches, Doc Info, etc.)

                   

                  Illustrator's script access interface--like too much in Illustrator--is half-baked. Sloppy. Rushed-to-market. Compare to InDesign's Scripts palette.

                   

                  Now that ScriptUI provides for creation of floating dialogs (and supposedly modeless palettes--something else that's quite problematic with Illustrator's scripting implementation), one can combine several scripts into one dialog to handle multiple user inputs. I may get around to doing that with closely-related groups of my scripts, but am currently just getting acquainted with the rather tedious ScriptUI model.

                   

                  There are ways to make a script run when the program is launched. So it may be conceivable to devise a startup script that would launch a script containing such a multi-purpose palette. But I haven't monkeyed around with that yet, because it would be dependent upon the afore-mentioned modeless dialog working correctly--you wouldn't want a modal dialog to appear whenever you launch the program.

                   

                  I'm certainly no advanced Javascripter; I'm a self-motivated, self-trained "student" and "experimenter" when the mood strikes.

                   

                  I'm gratified, by the way, that some of you seem to fiind my Join scripts handy. I consider the functionality indespensible in my own work, which is why I hacked them out. But it is absolutely absurd that one has to resort to custom scripting to do something that should so obvously be a standard function in the program.

                   

                  JET

                  • 6. Re: Illy CS3 Automating a Script
                    Van.T Level 1

                    so, you are saying it might be possible to create a startup script that will insert a menu item (say, a custom script) into the action? and if that action is used to execute a custom script, then you are essentially setting a shortcut to run your custom script?

                     

                    hallelujah! althought this is the most roundabout method ever, it would be groundbreaking! if anyone knows how to do this, please please please let me in on it.

                    • 7. Re: Illy CS3 Automating a Script
                      JETalmage-71mYin Level 3
                      function(){return A.apply(null,[this].concat($A(arguments)))}

                      so, you are saying it might be possible to create a startup script that will insert a menu item (say, a custom script) into the action?

                       

                      No. I was saying it might be possible to create a startup  script that would launch a javascript (non modal) palette. The palette would contain buttons with which to launch other Javascripts. I haven't tried this, and don't know how practical it would really be to have a Javascript palette hanging open all the time as you work, as if it were one of the normal palettes of the program.

                       

                      I don't think there's any way for a Javascript to "write" a step into an Action.

                       

                      JET