Re: Deleting Folder Contents
Re: Deleting Folder Contents
- Subject: Re: Deleting Folder Contents
- From: Axel Luttgens <email@hidden>
- Date: Mon, 11 Oct 2010 22:45:53 +0200
Le 11 oct. 2010 à 19:47:18, Luther Fuller a écrit :
> [...]
>
> On Oct 11, 2010, at 11:52 AM, Axel Luttgens wrote:
>
>> Something like this works here:
>>
>> tell application "System Events"
>> delete (get disk item "x" of folder "a" of desktop folder)
>> end tell
>
> I'm trying to delete 'every item' of the folder without inquiring into its name.
> I suppose I could get a list of the items in the folder, then delete each item in
> a repeat loop. But, it ought to be simpler.
>
> [...]
Then try by specifying more specific classes:
tell application "System Events"
tell folder "a" of desktop folder
delete files
delete folders
end tell
end tell
Class "disk item" often appears too generic for many System Events' operations.
HTH,
Axel
_______________________________________________
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