Re: tell app, name in string var
Re: tell app, name in string var
- Subject: Re: tell app, name in string var
- From: KOENIG Yvan <email@hidden>
- Date: Fri, 27 May 2011 12:27:18 +0200
Le 27 mai 2011 à 10:26, Thomas Fischer a écrit :
Hi,
thanks to all who answered. The different versions of coercions ("as alias", "as text") seem to hint at some sort of additional evaluation taking place. But actually it appears as buggy support of POSIX paths by the Finder.
Background of this small exercise is that I need a new file for a shell script, so I check for files until I find a name that isn't taken. In this context it is natural to work with POSIX paths, and the Finder is the authority for the existence of files...
Anyway, from the different hints I finally came up with the following:
set newFile to "/RemoteDesk/GDZ-METS/METS/Jochen.txt" tell application "Finder" exists my (POSIX file newFile) end tell
and this works without errors! So one has to wrestle the POSIX file out of the Finder's hands ( exists AppleScript's (POSIX file newFile) works as well) and then let the Finder check its existence. So something is broken in the interaction of the Finder with the "StandardAdditions" OSAX, which implements POSIX.
Cheers Thomas
No bug here in the delivered tools.
In the documentation delivered with 10.6's AppleScript, the fact that calling an OSAX inside a tell block will issue an error is documented so, each time you call POSIX in a tell block, you are the bug's author.
Yvan KOENIG (VALLAURIS, France) vendredi 27 mai 2011 12:26:56 |
_______________________________________________
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