Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Delete a Finder file via script


Recommended Posts

Goodmorning everyone
How do you physically delete a file from the finder via script?
I have a PDF file in the Finder which, after printing, via script I would like to delete.
I do not know what instructions I have to use to do it. How do you trash it?

Thanks so much

Link to comment
Share on other sites

Perform AppleScript — calculated applescript

Let (qmk= "\"";

"do shell script " & qmk & "rm " & $PathToPDF& qmk



Presumably after printing it you know its path.  Using Perform AppleScript to execute a command line unix command to nuke the file is the most effective way.  (In the old MacOS 9 days I would have told the Finder to do it but the shell script is shorter and faster)



Link to comment
Share on other sites

  • Create New...

Important Information

Terms of Use