Copy link to clipboard
Copied
Hello hopefully someone can help. I've got some javascript i'd like to run. Basically I'd like to get the title of the pdf and save the file as that name. I've found some javascript on how to edit the title
e.g.
this.info.title = "My Summer Vacation"; // Set the Document Title and also how to save as a given name
this.saveAs("/c/MyDocs/" + this.documentFileName);and I've tried to combine them by doing this:
this.saveAs("C:/FILELINK/" + this.info.title);but this isn't working. Does anyone have any ideas please?
Copy link to clipboard
Copied
I see a couple of issues, yes.
- From what context are you running the code? The saveAs method requires privileged context.
- Your file path has an incorrect syntax, plus it's missing the file extension. Try this:
this.saveAs("/C/FILELINK/" + this.info.title + ".pdf");
If something is not working it will be helpful to specify what exactly happens when you try it.
There's probably an error message, so what does it say?
Copy link to clipboard
Copied
I see a couple of issues, yes.
- From what context are you running the code? The saveAs method requires privileged context.
- Your file path has an incorrect syntax, plus it's missing the file extension. Try this:
this.saveAs("/C/FILELINK/" + this.info.title + ".pdf");
If something is not working it will be helpful to specify what exactly happens when you try it.
There's probably an error message, so what does it say?
Copy link to clipboard
Copied
Thank you so much, that worked perfectly!
I'm running it from the Action Wizard and it wasn't throwing up any error messages unfortunately.
Copy link to clipboard
Copied
Press Ctrl+J and you'll see the error message there.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now