1 Reply Latest reply on Oct 10, 2014 1:49 AM by bastieneichenberger

    execute javascript with apple script in INDD   photoshop

    bastieneichenberger Level 1

      Hi all,

       

      I try to execute a javascript file with applescript by this way:

       

      -- works in indesign
      tell application "Adobe InDesign CC 2014"
          activate
          do script "Macintosh HD:Applications:MAMP:htdocs:extendscript-library.org:tests:test:fixtures:helper:log:test_log.jsx" language javascript
      end tell
      
      -- works in photoshop
      tell application "Adobe Photoshop CC 2014"
          (activate) & (do javascript file "/Applications/MAMP/htdocs/extendscript-library.org/tests/test/fixtures/helper/log/test_log.jsx")
      end tell
      
      -- but why this script does't work
      tell application "Adobe Photoshop CC 2014"
          activate
          do script "Macintosh HD:Applications:MAMP:htdocs:extendscript-library.org:tests:test:fixtures:helper:log:test_log.jsx" language javascript
      end tell
      

       

      The test_log.jsx content just an alert : alert('test');

      I don't understand why the syntax is different if I call Photoshop or Indesign.

      I would like to do someting like this:

       

      -- works in photoshop

      tell application "Adobe Photoshop CC 2014"

          (activate) & (do javascript file "/Applications/MAMP/htdocs/extendscript-library.org/tests/test/fixtures/helper/log/test_l og.jsx")

      end tell

       

      -- works in photoshop

      tell application "Adobe InDesign CC 2014"

          (activate) & (do javascript file "/Applications/MAMP/htdocs/extendscript-library.org/tests/test/fixtures/helper/log/test_l og.jsx")

      end tell

       

      Thanks you for your help!

      Have a nice day!

        • 1. Re: execute javascript with apple script in INDD   photoshop
          bastieneichenberger Level 1

          Hi all, I was continuing to search a best way and I found this:

          tell application "Adobe InDesign CS6"
              activate
              do script "Macintosh HD:Applications:MAMP:htdocs:extendscript-library.org:tests:test:fixtures:helper:log:test_log.jsx" with arguments {1, 2} language javascript
          end tell
          
          tell application "Adobe Photoshop CC 2014"
              activate
              do javascript file "Macintosh HD:Applications:MAMP:htdocs:extendscript-library.org:tests:test:fixtures:helper:log:test_log.jsx" with arguments {1, 2}
          end tell
          
          tell application "Adobe Illustrator"
              activate
              do javascript file "Macintosh HD:Applications:MAMP:htdocs:extendscript-library.org:tests:test:fixtures:helper:log:test_log.jsx" with arguments {1, 2}
          end tell