7 Replies Latest reply on Oct 23, 2015 6:03 AM by LeoMari

    Running JavaScript from Actions Panel

    Puthoskey

      Hi guys

       

      I have a little question…

      How can I execute/run a JavaScript file FROM "Actions Panel”?

      Or what do you recommend to do this? ideas?

       

      Ok, many thanks for your time!

        • 1. Re: Running JavaScript from Actions Panel
          Larry G. Schneider Adobe Community Professional & MVP

          You can do it by using the Insert Menu Item from the Action panel flyout but be advised it will not survive a restart of AI.

          • 2. Re: Running JavaScript from Actions Panel
            Puthoskey Level 1

            Is there another better way? or a way to convert it to plugin or extension?

            It disappears when I restart Illustrator and I want it to disappear :/

             

            Thanks for your help!

            • 3. Re: Running JavaScript from Actions Panel
              Larry G. Schneider Adobe Community Professional & MVP

              The only way around this is to save the Action Set after making the action and then reload it after every restart of AI.

              • 4. Re: Running JavaScript from Actions Panel
                Puthoskey Level 1

                Sorry but it disappear after loading the actions with "Insert Menu Item"

                Take a loo[k the picture… :/

                Screen Shot 2015-10-22 at 12.31.57 PM.png

                • 5. Re: Running JavaScript from Actions Panel
                  Silly-V Adobe Community Professional

                  depending on your specific platform, a script to re-load your specific actions can be crafted.

                  Qwertyfly... was working on such a script.

                   

                  The requirement of loading the action is having at some point of time revealed the File menu in Illustrator's menu bar.
                  Once this menu is shown, re-loading the actions in the actions panel properly shows the scripts within the actions.

                  However, another issue, I believe, is that through scripting we can't really tell how many actions are loaded into the panel or what their names are, we can just load and unload the ones whose names we already know, and are limited to only rudimentary ways of checking whether a named action exists.

                   

                  In its most basic form, a re-loading script can be hardcoded with a path to seek actions in a special folder that you use to save action sets into for this purpose, and it can be placed into the File / Scripts menu so that by manually activating this item, the requirement of showing the file menu is satisfied. Now you just have to run this every time Illustrator restarts, once. To better it further, a platform-specific script can be used in conjunction with the Startup Scripts folder inside the application folder which could reveal the file menu and run the reloading script as if a user did it, when Illustrator starts.

                   

                  If a platform-specific script can be launched from the startup folder, and it could trigger the file menu, then there should be an ability to just run the re-loading part without requiring this to be inside the File/Scripts folder.
                  The challenge with this most robust approach is having the javascripts and platform scripts play well with each other and the actual Illustrator application too. And then it's also a matter of being able to manipulate the UI through the platform scripts of both Macs and PCs and as many versions of Illustrator on each as possible.

                   

                   

                  A different and cumbersome approach could also be to make a custom script palette which could contain references to actions and scripts (this could be activated at startup and will not lose info like the Actions panel does) and you could have a view which lets you make a custom "script/action" set in a listbox where you can add items from a pool of found actions and scripts and also save these configurations in a saved settings file. Then instead of playing actions from the actions panel, you'd use this script-based palette to play your own creations of mixed script and action items. The script would be simply executed as a script via bridgetalk, and actions would be also loaded and played in the actions panel via a script which does this which also would be sent via bridgetalk. This kind of method would let you save and persist your custom action/script sets. The problem is that the scripts would have to be separate from the actions, so if one action played a script in the middle of it, it would need to be split into two different action items and the script part would need to be sandwiched into that. Also, even manual File-menu showing and reloading one time on restart to use the native reloading of actions in the actions panel is a very simple bit of effort that my laziness to work on what I described above outweighs my laziness not to manually reload.

                  • 6. Re: Running JavaScript from Actions Panel
                    W_J_T Level 4

                    Probably the best option is walking up to the front door at '345 Park Avenue. San Jose, CA' and asking for the inept people behind the failure to fix such a basic ongoing and widely discussed issue for a decade or better?

                    • 7. Re: Running JavaScript from Actions Panel
                      LeoMari Level 2

                      Recommend the installation script Bay app (http://in-tools.com/article/script-bay/script-panel-replacement-for-the-entire-creative-su ite/). In it you let your Active Scripting in the panel. So you can build your actions as scripts and let them view ..

                       

                       

                      Hug!