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 |