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

call/run applescript from javascript

Contributor ,
Jun 23, 2018 Jun 23, 2018

Hi,

How to call applescript code from javascript..

I want to run some applescript code via javascript in illustrator

pls help

TOPICS
Scripting
2.9K
Translate
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
Adobe
Community Expert ,
Jun 23, 2018 Jun 23, 2018

The only way that I know (only tested with photoshop)

Save your *.scpt as app and then try this snippet:

// save your scpt as app befeore testing!!!

var appleScript = new File('~/Desktop/Test.app');

if (appleScript.exists) {

    appleScript.execute();

    }

Please give a feedback if this works for you. (I haven't a Mac for testing)

Translate
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 ,
Jun 23, 2018 Jun 23, 2018

no i have already tried that.. but it did not worked

Translate
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
Community Expert ,
Jun 23, 2018 Jun 23, 2018

Only for interest:

And …

… works that snippet in Photoshop for you?

Translate
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
Valorous Hero ,
Jun 23, 2018 Jun 23, 2018

This kind of method works for me. To take it up a power level, it is possible to create an "ApplescriptExecutor.app" whose sole purpose is to run a sample file that is always called something like "MyScript.scpt". When a .jsx file dynamically writes the scpt in that location and follows with an .execute() on the .app, it effectively runs a custom-made applescript which can be different every time!

Translate
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 ,
Oct 26, 2018 Oct 26, 2018

can you pls send the sample script?

Translate
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
Valorous Hero ,
Oct 27, 2018 Oct 27, 2018
LATEST

It would be the same as pixxxel's snippet , if your .app contains a basic display alert it should work when you do .execute() on your .app from inside your .jsx.

Translate
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