• 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: tell app, name in string var
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: tell app, name in string var (From: tom wible <email@hidden>)
 >Re: tell app, name in string var (From: Thomas Fischer <email@hidden>)
 >Re: tell app, name in string var (From: Jan-Bultereys <email@hidden>)
 >Re: tell app, name in string var (From: Christopher Stone <email@hidden>)
 >Re: tell app, name in string var (From: Thomas Fischer <email@hidden>)

  • Prev by Date: Re: tell app, name in string var
  • Next by Date: Re: tell app, name in string var
  • Previous by thread: Re: tell app, name in string var
  • Next by thread: Re: tell app, name in string var
  • Index(es):
    • Date
    • Thread