Skip to main content
Inspiring
July 12, 2023
Question

open doc with relative path

  • July 12, 2023
  • 1 reply
  • 1074 views

I want to open "MyDoc.pdf" from "FirstDoc.pdf " using a relative path. Say "FirstDoc.pdf " resides in the folder "Home" and "MyDoc.pdf" resides in "Home/Forms/".  My script in "FirstDoc.pdf " is in a mouse up action of a button. It does not work. 

     app.openDoc({cPath: "Forms/MyDoc.pdf"}); 

How should this be constructed?

Second question: how should this script be constructed if "MyDoc.pdf" resides in the same folder as "FirstDoc.pdf"?

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
July 12, 2023

You should really read the documentation of this method (openDoc)... The answers to your questions are there.

ODuinnAuthor
Inspiring
July 13, 2023

OK, I deserved that. Found it. But I have a follow-up question, and I have looked for this, unsuccessfully: Is there a list somewhere on Adobe.com of the primary JavaScript documentation? I have copies of the Object Specification Guide, the JS Tools Guide, Adobe Scripting Introduction, Adobe Scripting Reference, and API Reference. I also have some JS books that I've purchased, but is there more primary Adobe JS documentation, and if so, do you have a URL for it that you will share please? 

try67
Community Expert
Community Expert
July 13, 2023

Do you mean of the core syntax? If so, this is pretty close, I think:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference

However, you should make sure you only use the non-browser specific objects, and ones that are supported by the version of JS that's used in Acrobat. Basically, the simpler/earlier, the better.