Jump to content
Luke02

Delete a Finder file via script

Recommended Posts

Luke02

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

Share this post


Link to post
Share on other sites
AHunter3

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)

 

 

Share this post


Link to post
Share on other sites
Luke02

Many thanks. 

Italy  here   :)

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×