Re: tell app, name in string var
Re: tell app, name in string var
- Subject: Re: tell app, name in string var
- From: Christopher Stone <email@hidden>
- Date: Sat, 28 May 2011 05:25:32 -0500
On May 27, 2011, at 18:39, Shane Stanley wrote: The AppleScript team has frowned on using "alias someHFSPath" in a try block, but it's solid and quick. The shell command test might be another alternative. ______________________________________________________________________
Hey Folks,
Let them frown. We've been using it for well over a decade. As Shane says "it's solid and quick". It takes about 0.001 seconds to run, although it's a trifle slower in a Finder Tell block. It's versatile.
set theFile to "Thor:Users:chris:test_directory:file.txt.falseExtension"
try theFile as alias on error errMsg number errNum set e to "Error: " & errMsg & return & "Error Number: " & errNum end try
set theFile to "/Users/chris/test_directory/file.txt.falseExtension"
try alias POSIX file theFile on error errMsg number errNum set e to "Error: " & errMsg & return & "Error Number: " & errNum end try
tell application "Finder" try POSIX file theFile as alias on error errMsg number errNum set e to "Error: " & errMsg & return & "Error Number: " & errNum end try end tell
-- Best Regards, Chris
|
_______________________________________________
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