• 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
Re: Deleting Files With System Events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deleting Files With System Events


  • Subject: Re: Deleting Files With System Events
  • From: Christopher Stone <email@hidden>
  • Date: Sun, 12 Dec 2004 22:32:32 -0600

Interestingly I seem unable to delete explicitly referenced items:

This fails:

 tell application "Finder"
   -- a single file
   set f to selection as alias
 end tell

 tell application "System Events"
   delete f
 end tell

and this:

 set f to alias "Lao-Tzu:Users:chris:Desktop:test:KateBosworth.jpg"

 tell application "System Events"
   delete f
 end tell


On the other hand this works:

 set fl to "Lao-Tzu:Users:chris:Desktop:test:"
 set fn to "KateBosworth.jpg"

 tell application "System Events"
   delete file fn of folder fl
 end tell


I wonder if this has anything to do with the fact that there are two 'delete' commands in System Events - one in the Standard Suite and one in the Disk-Folder-File Suite.



Chris



_______________________________________________
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: Paul Berkowitz <email@hidden>
References: 
 >Deleting Files With System Events (From: Tom McKenna <email@hidden>)

  • Prev by Date: Re: Deleting Files With System Events
  • Next by Date: Re: Deleting Files With System Events
  • Previous by thread: Re: Deleting Files With System Events
  • Next by thread: Re: Deleting Files With System Events
  • Index(es):
    • Date
    • Thread