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

Execute external application with arguments

Contributor ,
Apr 23, 2024 Apr 23, 2024

Copy link to clipboard

Copied

Hi,

 

Using Extendscript, how do you execute an external executable with arguments?

 

var myFile = new File("Path to app/app.exe 'arg1' 'arg2'"):

myFile.execute();

 

It doesn't seem to be supported.

 

Thanx

 

tm

 

TOPICS
Scripting

Views

130

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
Community Expert ,
Apr 23, 2024 Apr 23, 2024

Copy link to clipboard

Copied

File() isn't for executing other applications.

 

https://www.google.com/search?client=firefox-b-d&q=javascript+execute+exe+with+arguments

 

Or maybe it is possible to use File():

https://www.ps-scripts.com/viewtopic.php?p=138643&sid=be944028500c9f098ea14b19c48ebe77#p138643

 

Sorry, I'm not JS guy.

 

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 ,
Apr 23, 2024 Apr 23, 2024

Copy link to clipboard

Copied

Possibly with bridgetalk, although I think that is specifically for Adobe products.

If you are on an apple machine, it might be possible by calling an applescript that then calls the executable.

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
Community Expert ,
Apr 23, 2024 Apr 23, 2024

Copy link to clipboard

Copied

Hi @tmmls , Do you mean you want to open a file in another Adobe application? If that‘s the case you would have to use a BridgeTalk object as @John D Herzog  suggests.

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
Guide ,
Apr 24, 2024 Apr 24, 2024

Copy link to clipboard

Copied

LATEST

If you don't mind technology hopping, you can take advantage of InDesign's VBscript:

ExtendScript >> VBScript >> Windows Script Host >> app.exe

E.g. to show a file in Explorer (that would be the external executable).

 

app.doScript(
"CreateObject(\"WScript.Shell\").Run \"explorer /n,/e,/select,"+f.fsName+"\"",ScriptLanguage.visualBasic);

 

I wrote this for CS3 and haven't tested it in a while.

 

Otherwise, your File() could be a shell script or alike that passes on the parameters. Likely that would involve ugly terminal windows, though.

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