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

Is it Possible terminal command via ExtendScript toolkit?

Participant ,
Nov 16, 2015 Nov 16, 2015

Copy link to clipboard

Copied

Hi everyone!

I need to use terminal command using javascript on extendscript.

But, i will automate the script on macintosh and windows operating systems.

Is it possible to use both in same code?

For Example,  i will automate the pdffonts names in the pdf files. so, i use the command on mac "pdffonts /Users/user/Desktop/fontlist/pdf"  that gives the pdf font names. That works on manually. Is it possible to use code for mac and windows on extendscript toolkit?  or separately give a code!

Thanks,

Peter.

TOPICS
Scripting

Views

1.1K

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

Community Expert , Nov 17, 2015 Nov 17, 2015

I am not sure how this works on the Mac, but with Windows, you can have your commands in a batch file and then execute that with ExtendScript. For example, here is a script that creates a batch file and then executes it:

var bat = File ("~\\temp.bat");

bat.open ("w");

bat.writeln ('start Notepad.exe "C:\\DATA\\Scripts\\results.log"');

bat.writeln ('quit');

bat.close ();

bat.execute (); // This is what runs the batch file (like a double-click on it in Windows Explorer).

You can detect the OS that

...

Votes

Translate

Translate
Contributor ,
Nov 17, 2015 Nov 17, 2015

Copy link to clipboard

Copied

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 ,
Nov 17, 2015 Nov 17, 2015

Copy link to clipboard

Copied

I am not sure how this works on the Mac, but with Windows, you can have your commands in a batch file and then execute that with ExtendScript. For example, here is a script that creates a batch file and then executes it:

var bat = File ("~\\temp.bat");

bat.open ("w");

bat.writeln ('start Notepad.exe "C:\\DATA\\Scripts\\results.log"');

bat.writeln ('quit');

bat.close ();

bat.execute (); // This is what runs the batch file (like a double-click on it in Windows Explorer).

You can detect the OS that the script is running on by using $.os. On my system this

alert ($.os);

displays "Windows/7/64 6.1 Service Pack 1 (32-bit emulation)". -Rick

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 ,
Nov 19, 2015 Nov 19, 2015

Copy link to clipboard

Copied

Thank you very much for your reply...

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 ,
Nov 19, 2015 Nov 19, 2015

Copy link to clipboard

Copied

Hi John, If this solved your problem, please mark my answer correct. Thank you very much. -Rick

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 ,
Nov 19, 2015 Nov 19, 2015

Copy link to clipboard

Copied

LATEST

hi,

your answer works on windows perfectly.

Thank you.

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