• 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: Stan Cleveland <email@hidden>
  • Date: Tue, 06 Nov 2012 15:16:26 -0800

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.

 _______________________________________________
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: Robert Poland <email@hidden>
  • Prev by Date: Re: "try" broke???
  • Next by Date: Re: "try" broke??? II
  • Previous by thread: Re: "try" broke???
  • Next by thread: Re: "try" broke???
  • Index(es):
    • Date
    • Thread