• 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: Simply deleting a fil
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simply deleting a fil


  • Subject: Re: Simply deleting a fil
  • From: Michelle Steiner <email@hidden>
  • Date: Fri, 17 Apr 2009 09:45:30 -0700


On Apr 17, 2009, at 8:50 AM, Luther Fuller wrote:

Using Finder puts the file into the trash; using System Events deletes the file completely.

Interesting ... so I tried it. But, I found that System Events works just like Finder.

I tried your script, and it worked as you described.

However, this script deletes the folder without putting it in the trash.

set foo to ((path to desktop as text) & "untitled folder")
tell application "System Events"
delete folder foo
end tell

This one, though, puts the folder in the trash:

tell application "Finder"
set foo to item 1 of (get the selection)
end tell
tell application "System Events"
delete foo
end tell

My conclusion is that if the item is referenced as a Finder Object, it is put in the trash, but if it is referenced as an alias (or folder or file, as appropriate), it deletes the item without putting it in the trash.

-- Michelle

-- 
Some people run to live.
I live to run.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Simply deleting a fil
      • From: Christopher Nebel <email@hidden>
    • Re: Simply deleting a fil
      • From: Emmanuel Levy <email@hidden>
References: 
 >Re: Photomerge (From: Stan Cleveland <email@hidden>)
 >Simply deleting a fil (From: Satyam Satyanarayana <email@hidden>)
 >Re: Simply deleting a fil (From: Yvan KOENIG <email@hidden>)
 >Re: Simply deleting a fil (From: Tim Mansour <email@hidden>)
 >Re: Simply deleting a fil (From: Michelle Steiner <email@hidden>)
 >Re: Simply deleting a fil (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: Simply deleting a fil
  • Next by Date: Re: Simply deleting a fil
  • Previous by thread: Write Text file in Little Endian UTF-16 format
  • Next by thread: Re: Simply deleting a fil
  • Index(es):
    • Date
    • Thread