Re: "try" broke???
Re: "try" broke???
- Subject: Re: "try" broke???
- From: Doug McNutt <email@hidden>
- Date: Tue, 06 Nov 2012 15:49:06 -0700
At 15:26 -0700 11/6/12, 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
It sounds more like the delete command is broke.
How about this:
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
if fileList contains ".DS_Store" then
try
delete item ".DS_Store"
end try
end if
end tell
end tell
--
--> From the U S of A, the only socialist country that refuses to admit it. <--
_______________________________________________
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