• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Execute JavaScript via Applescript

Participant ,
Feb 22, 2017 Feb 22, 2017

Copy link to clipboard

Copied

Hi

There is a way to execute JavaScript via Applescript in InDesign using do script

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

Since command do script doesn't work for Illustrator, Is there a way to tell via AppleScript to:

1. Execute Script from custom location (⌘cmd + F12)

2. Pick the script to be executed by name

Perhaps there is other work around to do this? Any support via OS X JavaScript?

TOPICS
Scripting

Views

3.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Feb 22, 2017 Feb 22, 2017

Try this, HTH.

tell application "Adobe Illustrator" to open file "Macintosh HD:Applications:MAMP:htdocs:extendscript-library.org:tests:test:fixtures:helper:log:test_log.jsx"

Votes

Translate

Translate
Adobe
Valorous Hero ,
Feb 22, 2017 Feb 22, 2017

Copy link to clipboard

Copied

You should be able to use do javascript to do it, I believe.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 22, 2017 Feb 22, 2017

Copy link to clipboard

Copied

I forgot to mention, that I'd like to keep the repository of JavaScripts in a custom folder (not Illustrator script folder).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Feb 22, 2017 Feb 22, 2017

Copy link to clipboard

Copied

do script is InDesign only. Not to confuse with do javascript which is available for AI & PS:

do javascriptv : execute a javascript

do javascript any : javascript code or file to execute

[with arguments list of any] : arguments to pass to the JavaScript routine

[show debugger before running/‌never/‌on runtime error] : when should a debugger be shown? ( default: never )

text : execute a javascript

HTH

Loic

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 22, 2017 Feb 22, 2017

Copy link to clipboard

Copied

Try this, HTH.

tell application "Adobe Illustrator" to open file "Macintosh HD:Applications:MAMP:htdocs:extendscript-library.org:tests:test:fixtures:helper:log:test_log.jsx"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

Nice. I wasn't aware of that. It looks like Illustrator only as nor InDesign, nor Photoshop accept that piece of code (given of course that the target application has been changed).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

LATEST

It worked up to Photoshop CS5, but I guess things have changed.

(I'm a CS6 user)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines