• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Deleting Files With System Events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Deleting Files With System Events


  • Subject: Deleting Files With System Events
  • From: Tom McKenna <email@hidden>
  • Date: Sun, 12 Dec 2004 21:56:36 -0500

A quick observation, followed by a couple of questions...

If I use run this script, the files on on my desktop are deleted:

tell application "Finder"
delete every file of desktop folder
end tell

If you want, you can double-click on the trash and find them (and even take them out of the trash). In fact, if you are in the Finder and you can type command-z and the files reappear on your desktop.

If you run this script, the files are also deleted:

tell application "System Events"
delete every file of (path to desktop)
end tell

However these files seem to have disappeared completely -- they're not even in the trash!

OK, here are my questions:

Is this behavior correct?
If this is correct, why is it correct?
Are the files really and truly gone forever?
If they aren't, where are they?

Curious,
Tom McKenna

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Deleting Files With System Events
      • From: Christopher Stone <email@hidden>
    • Re: Deleting Files With System Events
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: set the clipboard not available in in some apps (like Word)
  • Next by Date: Re: Deleting Files With System Events
  • Previous by thread: Re: multiple Airport configurations
  • Next by thread: Re: Deleting Files With System Events
  • Index(es):
    • Date
    • Thread