13 Replies Latest reply on May 13, 2013 9:55 PM by Larry G. Schneider

    apple script execute via do script (using javascript).

    csm_phil Level 4

      Hi Scripters,

       

      Can you any one please look into this and solve my problem.

      My request I want to delete the unused swatches in Illustrator, So that I used the apple script its working fine, the same code i want to execute via do script (java Script).

       

      The below Lines I used the Apple script its working fine in the MAC.

      After I save as the script file, and app file. I want to execute this from Illustrator using java script but its not working.

       

      ----------------------

      tell application "Adobe Illustrator"

         activate

         tell current document

           do script "Delete Unused Panel Items" from "Default Actions" without dialogs

         end tell

        end tell

      --------------------

       

       

      var mege_excel = File(getScriptPath().parent+ "/ILLUS.scpt");

      app.doScript(mege_excel, ScriptLanguage.applescriptLanguage);

       

      function getScriptPath() {

        try {

              return app.activeScript;

              }catch(e) {

                  return File(e.fileName);

                  }

              }

       

      thx,

      csm_phil