Skip to main content
MSAII
Inspiring
March 5, 2022
Answered

Is it possible to call the "command prompt" or "exe / bat" in the Javascript executable code?

  • March 5, 2022
  • 1 reply
  • 491 views

Hello.

 

Thank you for participating in this silly issue.

 

When executing Javascript, you can execute the program automatically from the command prompt by writing the file path of illustrator.exe and the file path of javascript in the bat file.

 

But is the opposite possible?

I haven't found it.

 

My ideal is to issue commands to the outside in some way, like Visual Basic command line commands, when running javascript in illustrator.

 

I looking for any method.

 

I can use multiple programming languages ​​so I don't have to limit myself to Javascript or the command line.


However, the ideal is the command line.

 

Adobe doesn't have to deal with this question seriously, but I think it has an obligation to expand the coverage of Javascript.

 

However, there is no disadvantage if it is not solved.


This problem is for my self-satisfaction.

This topic has been closed for replies.
Correct answer Ten A

日本語コミュニティに英語で書き込むって訳分からんっ!

 

と言いつつ、VBスクリプトなりAppleScriptなりをファイルとして作成しておいてJavaScript上でファイルインスタンスとして読み込めばあとはexecuteメソッドで実行すれば動きます。

しかし、回りくどく面倒なのでCEPに実装されてるプロセス操作を利用する方が簡単ですし、SDK使ってプラグイン作る方が自由度は高いでしょう。

 

 

……英語の方が良かった?

1 reply

Ten A
Community Expert
Ten ACommunity ExpertCorrect answer
Community Expert
March 5, 2022

日本語コミュニティに英語で書き込むって訳分からんっ!

 

と言いつつ、VBスクリプトなりAppleScriptなりをファイルとして作成しておいてJavaScript上でファイルインスタンスとして読み込めばあとはexecuteメソッドで実行すれば動きます。

しかし、回りくどく面倒なのでCEPに実装されてるプロセス操作を利用する方が簡単ですし、SDK使ってプラグイン作る方が自由度は高いでしょう。

 

 

……英語の方が良かった?

MSAII
MSAIIAuthor
Inspiring
March 5, 2022

Ten A様

返信ありがとうございます。

 

あれ、日本語コミュニティに投稿してたのは気づきませんでした。

すみませんわざわざ解読してくれてありがとうございます。

 

調べてみました。

別件のTen A様の返信を発見しましてやれそうなので実験してみます。

お手数おかけしましてすみませんありがとうございます。

 

あと別件ですが先日はTwitterのほうでお世話になりました、そちらも解決しました。ありがとうございます。

MSAII
MSAIIAuthor
Inspiring
March 5, 2022

var f = new File("C:~~~~~filename.exe");
f.execute();

無事に動作しました。

解決です。