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

A way to call an Illustrator File/Script from another script?

Participant ,
Jul 30, 2017 Jul 30, 2017

Copy link to clipboard

Copied

If I have a script inside Illustrator's File/Script menu I would like to run from a script outside Illustrator.

The only code I found that might be related is:

app.executeMenuCommand("script name here?");

I'll take any examples in either VBscript or JavaScript. 

Thx,

Clutch

TOPICS
Scripting

Views

2.4K

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

Participant , Jul 31, 2017 Jul 31, 2017

Thx, I also think I found what I want using VBscript:

objApp.DoJavaScriptFile "path to JS file"

Votes

Translate

Translate
Adobe
Community Expert ,
Jul 31, 2017 Jul 31, 2017

Copy link to clipboard

Copied

You can use the execute method under the File object, Not executeMenuCommand.

var f = new File("YOUR SCRIPT FILE PATH HERE");

f.execute();

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 ,
Jul 31, 2017 Jul 31, 2017

Copy link to clipboard

Copied

Thx, I also think I found what I want using VBscript:

objApp.DoJavaScriptFile "path to JS file"

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
Explorer ,
Jan 11, 2021 Jan 11, 2021

Copy link to clipboard

Copied

This doesn't work properly if the default application that the script is set to open in is anything but Illustrator (or whatever other Adobe app). I have my .jsx scripts set to open in Visual Studio Code by default when I click on them, which means doing

f.execute();

 will just do exactly that and not actually run the script, instead of executing them in Illustrator like desired.

 

I can't seem to find a way to force them to execute in Illustrator all the time.

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
Explorer ,
Jan 12, 2021 Jan 12, 2021

Copy link to clipboard

Copied

LATEST

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