• 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: 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

  • Follow-Ups:
    • Re: tell app, name in string var
      • From: Thomas Fischer <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>)

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