Re: "try" broke???
Re: "try" broke???
- Subject: Re: "try" broke???
- From: Robert Poland <email@hidden>
- Date: Tue, 06 Nov 2012 16:24:52 -0700
On Nov 6, 2012, at 4:16 PM, Stan Cleveland < email@hidden> wrote: On Nov 6, 2012, at 2:26 PM, Robert Poland wrote: Running from Smile AND Applescript Editor, when pointed at a CD the following script errors out and won't run;
Hi Robert,
Here's my take on what's needed to achieve your goal:
tell application "Finder" activate tell window 1 -- clears out Finder idiosyncrasies (will take your word on that) tell application "Finder" set winTarget to target of front window as alias end tell end tell end tell set fileList to list folder winTarget with invisibles -- from standard additions — should not be inside a 'tell' if fileList contains ".DS_Store" then tell application "Finder" -- 'tell window 1' and 'try' are not needed delete item ("" & winTarget & ".DS_Store") -- needs a full path end tell end if
HTH, Stan C.
Stan,
This is part of a script that is applied to all finder windows. If it is applied to a CD window it should not error, which is what your script does. That was the reason for the try block.
Robert Poland - Fort Collins, CO
|
_______________________________________________
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