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

Executing a program from a script

Advocate ,
Aug 10, 2014 Aug 10, 2014

Copy link to clipboard

Copied

Hi all,

Is there a way to run a program (some exe, with optional commandline arguments) from within a script ?

Thanks

Jang

TOPICS
Scripting

Views

662

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
Engaged ,
Aug 10, 2014 Aug 10, 2014

Copy link to clipboard

Copied

Hi Jang,

You can use File.execute to run an external exe file.

But you can't provide parameters.

In such cases I always write a temporary batch file and call

new File("foo.bat").execute()

Hope this helps

Markus


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
Advocate ,
Aug 10, 2014 Aug 10, 2014

Copy link to clipboard

Copied

Hi Markus,

Yes, that would work. It is kind of clumsy, having to write a batch file just because I want to pass a parameter to an existing program, but if there is no other way to do it, it will have to be done this way. I was looking for an existing client that might give me access to certain Windows functions, possibly using an ActiveXObject interface, but there seems to be no such thing in FM extendscript. There is an ActiveXObject in FrameScript, I think, and that does not seem to use a batch file to make it work.

Ciao

Jang

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
Engaged ,
Aug 10, 2014 Aug 10, 2014

Copy link to clipboard

Copied

Hi Jang,

 

perhaps ExternalObject could be a solution for that. ExternalObject allows ExtendScripts to call functions in C dlls.

So an ExternalObject works as a connector to a world outside of ExtendScripts, with interfaces in both ways.

    

There is an example for ExternalObjects in Adobe\Adobe Utilities\ExtendScript Toolkit CS4\SDK\Samples\cpp.

Don't know if this works or could be a solution for this and I don’t know if my thoughts are in the right direction.

I hope this information is useful nevertheless.

If there is a way, which is easier or if somebody has got experiences with ExternalObjects please let me know.

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
Advocate ,
Aug 10, 2014 Aug 10, 2014

Copy link to clipboard

Copied

LATEST

Hi Markus,

Good idea, but in this case there is no DLL that performs the same functions as an EXE which does exist. I guess I will have to go via the batch file approach here. Thanks anyway. I will keep that option in mind for possible other applications.

Jang

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