Re: "try" broke???
Re: "try" broke???
- Subject: Re: "try" broke???
- From: John Day <email@hidden>
- Date: Tue, 06 Nov 2012 17:41:46 -0500
You can try something like this:
tell application "Finder"
activate -- used here and at end
set winTarget to target of front window as alias
end tell
tell application "System Events" to delete (every file of winTarget whose name = ".DS_Store")
On Nov 6, 2012, at 5:26 PM, Robert Poland wrote:
> Hi,
>
> Running from Smile AND Applescript Editor, when pointed at a CD the following script errors out and won't run;
>
> tell application "Finder"
> activate
> tell window 1 -- clears out Finder idiosyncrasies
> tell application "Finder" -- used here and at end
> set winTarget to target of front window as alias
> end tell
> set fileList to list folder winTarget with invisibles
> try
> if fileList contains ".DS_Store" then
> delete item ".DS_Store"
> end if
> end try
> end tell
> end tell
>
>
> Robert Poland
> 2.7 GHz Intel Core I5, 27” iMac
> 12 GB Ram, 1TB HD
> OS X 10.8.2 (12C54)
> <Screen Shot 2012-11-06 at 3.26.06 PM.png>
> _______________________________________________
> 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
_______________________________________________
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