• 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: Jeremy Roussak <email@hidden>
  • Date: Tue, 06 Nov 2012 23:06:03 +0000

Robert,

Two points spring to mind:

1. You can't delete the file because it's on a CD, which is probably (definitely?) read-only.
2. Since you have no "on error" block within your "try", AppleScript is correct in flagging up the error: see https://developer.apple.com/library/mac/#documentation/applescript/Conceptual/ApplescriptLangGuide/reference/ASLR_error_xmpls.html.

Jeremy


Jeremy Roussak
email@hidden

On 6 Nov 2012, at 22:26, Robert Poland <email@hidden> 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

 _______________________________________________
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

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