[javascript] allow privileged execution of app.execMenuItem() for 'cmd.moveToTrash'  SOLVED

Please post any ideas or requests for new features here for the End User Version of PDF-XChange (printer Drivers)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange, Tracker - Clarion Support, John - Tracker Supp, Support Staff, moderators

User avatar
Mathew
User
Posts: 824
Joined: Thu Jun 19, 2014 7:30 pm

[javascript] allow privileged execution of app.execMenuItem() for 'cmd.moveToTrash'

Post by Mathew »

This is a bit of a niche issue, and probably quite low priority so I'm hesitant to ask; but it may be not too difficult to do IDK:

Currently 'cmd.moveToTrash' if run from app.execMenuItem() will fail, even if run from a trusted function, after showing two dialogs. It would be useful for scripts to be able to remove temporary utility files automatically, without the dialog if it's a file that's open hidden.
image(1).png
image.png
I understand this function could cause quite a bit of damage, but if restricted to a trusted function, that would limit the types of function that could do it. It also requires that the pdf be open to delete it.

The use case I'm thinking of are two:
1. For small "lock files" when pdfs are on shares that don't do file locking.
2. For cleaning up temporary files, or files that were created as part of a script (scripts can create files with doc.saveAs, or doc.exportAsFDF for example).
You do not have the required permissions to view the files attached to this post.
User avatar
Sean - PDF-XChange
Site Admin
Posts: 1039
Joined: Wed Sep 14, 2016 5:42 pm

Re: [javascript] allow privileged execution of app.execMenuItem() for 'cmd.moveToTrash'

Post by Sean - PDF-XChange »

Hi Mathew,

I've asked the devs to take a look at this.

Kind regards,
Sean Godley
Technical Writer
PDF-XChange Co LTD
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
User avatar
Sean - PDF-XChange
Site Admin
Posts: 1039
Joined: Wed Sep 14, 2016 5:42 pm

Re: [javascript] allow privileged execution of app.execMenuItem() for 'cmd.moveToTrash'  SOLVED

Post by Sean - PDF-XChange »

Update - I'm afraid this won't be implemented, due to security risks, as suspected.

Kind regards,
Sean Godley
Technical Writer
PDF-XChange Co LTD
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
User avatar
Mathew
User
Posts: 824
Joined: Thu Jun 19, 2014 7:30 pm

Re: [javascript] allow privileged execution of app.execMenuItem() for 'cmd.moveToTrash'

Post by Mathew »

image.png
Thanks for checking.
You do not have the required permissions to view the files attached to this post.
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 12862
Joined: Wed Jan 03, 2018 6:52 pm

[javascript] allow privileged execution of app.execMenuItem() for 'cmd.moveToTrash'

Post by Daniel - PDF-XChange »

:)
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
[email protected]