Luke02 Posted May 23, 2018 Share Posted May 23, 2018 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 More sharing options...
AHunter3 Posted May 23, 2018 Share Posted May 23, 2018 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 More sharing options...
Luke02 Posted May 24, 2018 Author Share Posted May 24, 2018 Many thanks. Italy here Link to comment Share on other sites More sharing options...
Recommended Posts