Highlighted

ES: run external app

Participant ,
Nov 08, 2015

Copy link to clipboard

Copied

Hello fellows,

I wonder if there is a way in ES to launch an external application (e.g., Acrobat) with a specified path to the PDF file?

I read about cross-DOM functions in the JS tools guide, but it's not clear where is the shared start up folder where a script with a call to acrobat.open should be put.

Do you have any input on that?

Thank you!

Hi rombanks

have a look at the Javascript tools file (around page 52):

execute()

fileObj.execute ()

Opens this file using the appropriate application, as if it had been double-clicked in a file browser.

You can use this method to run scripts, launch applications, and so on.

Returns true immediately if the application launch was successful.

This works for me:

var cFileName = YourPath + "/FM2015_mifref.pdf";

var cFile = new File (cFileName);

   

if (cFile.exists)

    {

    cFile.execute();

    }

else

    {

     alert ("File not found : " + cFileName);

     }

TOPICS
Scripting

Views

693

Likes

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

ES: run external app

Participant ,
Nov 08, 2015

Copy link to clipboard

Copied

Hello fellows,

I wonder if there is a way in ES to launch an external application (e.g., Acrobat) with a specified path to the PDF file?

I read about cross-DOM functions in the JS tools guide, but it's not clear where is the shared start up folder where a script with a call to acrobat.open should be put.

Do you have any input on that?

Thank you!

Hi rombanks

have a look at the Javascript tools file (around page 52):

execute()

fileObj.execute ()

Opens this file using the appropriate application, as if it had been double-clicked in a file browser.

You can use this method to run scripts, launch applications, and so on.

Returns true immediately if the application launch was successful.

This works for me:

var cFileName = YourPath + "/FM2015_mifref.pdf";

var cFile = new File (cFileName);

   

if (cFile.exists)

    {

    cFile.execute();

    }

else

    {

     alert ("File not found : " + cFileName);

     }

TOPICS
Scripting

Views

694

Likes

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
Nov 08, 2015 0
Enthusiast ,
Nov 08, 2015

Copy link to clipboard

Copied

Hi rombanks

have a look at the Javascript tools file (around page 52):

execute()

fileObj.execute ()

Opens this file using the appropriate application, as if it had been double-clicked in a file browser.

You can use this method to run scripts, launch applications, and so on.

Returns true immediately if the application launch was successful.

This works for me:

var cFileName = YourPath + "/FM2015_mifref.pdf";

var cFile = new File (cFileName);

   

if (cFile.exists)

    {

    cFile.execute();

    }

else

    {

     alert ("File not found : " + cFileName);

     }

Likes

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
Reply
Loading...
Nov 08, 2015 0
rombanks LATEST
Participant ,
Nov 09, 2015

Copy link to clipboard

Copied

Hi Klaus,

Thank you very much for your input! I just did not realize that I had to define the file as an object. I thought a variable with the filename/path is enough.

Thanks for your help!

Likes

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
Reply
Loading...
Nov 09, 2015 0