• 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: Paul Berkowitz <email@hidden>
  • Date: Sun, 12 Dec 2004 20:59:16 -0800

It doesn't work using 'alias', Chris.

You have to use 'file' or 'item' in a System Events block.

--
Paul Berkowitz


> From: Christopher Stone <email@hidden>
> Date: Sun, 12 Dec 2004 22:32:32 -0600
> To: <email@hidden>
> Subject: Re: Deleting Files With System Events
>
> 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
>


 _______________________________________________
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

References: 
 >Re: Deleting Files With System Events (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: Deleting Files With System Events
  • Next by Date: Another way to open files? (Droplet script with Canon Canoscan Toolbox)
  • Previous by thread: Re: Deleting Files With System Events
  • Next by thread: Another way to open files? (Droplet script with Canon Canoscan Toolbox)
  • Index(es):
    • Date
    • Thread