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: Thu, 26 May 2011 12:00:59 -0500
On May 26, 2011, at 11:37, Jan-Bultereys wrote: although it generates an error... the result is true, using this code:
______________________________________________________________________
Hey Jan,
That's a neat little trick. It's functionally equivalent to using a bare HFS path string, but the coercion allows you to pass the Posix path neatly into the Finder.
set newFile to "/Users/chris/test_directory/file.txt" set newFilePath to "Thor:Users:chris:test_directory:file.txt"
tell application "Finder" set pfExists to exists (POSIX file newFile as string) set fileExistsFlag to exists newFilePath
# Note that you can also coerce to alias:
set pfAliasExists to exists (POSIX file newFile as alias) end tell
Interesting.
-- 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