• 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: "try" broke???
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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;

 <code snipped>

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

  • Follow-Ups:
    • Re: "try" broke???
      • From: Stan Cleveland <email@hidden>
References: 
 >Re: "try" broke??? (From: Stan Cleveland <email@hidden>)

  • Prev by Date: Re: "try" broke??? II
  • Next by Date: Re: "try" broke???
  • Previous by thread: Re: "try" broke???
  • Next by thread: Re: "try" broke???
  • Index(es):
    • Date
    • Thread