2 Comments
User's avatar
Patrick McGuire's avatar

How can you choose the default folder for saving/ inserting to the Current Working Directory? Thanks

Expand full comment
David Dagley's avatar

To save the the current file, the script is app.execMenuItem("Save") which does not require privilege.

To get the folder path to the current PDF, the script is this.path.replace(this.documentFileName,"") which also does not require privilege. However, saving silently (without further user interaction) requires a privileged context. For example, to save in the folder of the current PDF with a different name you could use the following script:

var pth=this.path.replace(this.documentFileName,"New File Name.pdf");

this.saveAs(pth);

Unfortunately, you can't set the default file path for the Save As function but you can create your own toolbar button or menu item with a Save As browse window that defaults a file name in the Save As window, and also saves to a default location. This will be the subject of next week's post. Stay tuned...

Expand full comment