Copy link to clipboard
Copied
I want to specify the user's desktop in "cPath" specified in "saveAs" method, but I don't know how to set the path.
What should I do with the location of "username" ?
Is it useless below?
Used in a multilingual environment.
this.saveAs("/c/Users/%userprofile%/" + aaa + ".pdf");
Copy link to clipboard
Copied
There's no direct way of doing it. What can be done, though, since you have to run your code from a trusted context anyway is to use the app.getPath method to access one of the other user folders, like the Documents ones, and from there get the Desktop path. It's a bit of a hack, but it does work, as long as keep in mind that it can vary per operating system.
Copy link to clipboard
Copied
very thank you for your advice. I've never used the app.getPath method, but I'll check it. The difference in operating system is the difference from Windows 10 or 7, right? Or is it Mac?
Copy link to clipboard
Copied
Create a text box in the field and put it there
var i = app.getPath("Documents");
event.value = i.value;
I wrote, but nothing is displayed. .. ..
Is something wrong?
Copy link to clipboard
Copied
You have errors in your code, but also you can't use this method like that. Read up its documentation, especially the part related to the limitations of running it in a privileged context. Also see: https://acrobatusers.com/tutorials/trust-and-privilege-in-acrobat-scripts
Copy link to clipboard
Copied
I understood. This sounds difficult to me, but I'll read it.
Thank you for your advice.