zacurry suggested 3rd party solutions, however I have no idea how to use npm in zotero run javascript window.
Origin post:
Now the function OS.File.remove (file) was used, where file is the path, for example d:/files/aa.txt, however the file was removed directly from disk. Is there a function to move the file to the trash (Windows or Linux)?
Dan Stillman
unread,
Sep 3, 2021, 6:43:58 PM9/3/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to zoter...@googlegroups.com
Note that this doesn't have anything to do with "JavaScript" —
OS.File.remove() is specific to the Mozilla internals (and outdated
ones, at that) used in Zotero. This isn't really a question for
Stack Overflow.
There's no API for that in Mozilla or Zotero, and it's not something
you can really do in a proper way on other people's systems (where
you'd be limited to mv [1]).
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to zotero-dev
The user would have to have node installed. Alternately, you could bundle the executables from the trash npm module, and call them with Zotero.Utilities.Internal.exec
Minyi Han
unread,
Jan 26, 2022, 7:32:23 PM1/26/22
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to zotero-dev
Thanks Emiliano Heyns. Need I install nmp application first? And how to bundle
executables? Is there an example or code snippet?