• 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: quoted form of POSIX path (was: .. digest, Vol 3 #1900
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: quoted form of POSIX path (was: .. digest, Vol 3 #1900


  • Subject: Re: quoted form of POSIX path (was: .. digest, Vol 3 #1900
  • From: John Delacour <email@hidden>
  • Date: Tue, 5 Aug 2003 00:01:27 +0100

At 6:25 pm -0400 4/8/03, Jonathan Levi, M.D. wrote:

Apparently (I didn't know about this form, either.) All of the following work for me:

tell application "Finder" to get quoted form of POSIX path of ((disk "LaC 39000") as string)
tell application "Finder" to get quoted form of ((disk "LaC 39000") as string)
get quoted form of "a string"
get quoted form of (("a string") as Unicode text)

'as string' is a very bad idea in OS X. The Finder and the shell talk Unicode.


You may get a list of trues when you run this script, but that's only because you've selected a file with a 'convertible' name. As soon as you select a file with any other character in it, you'll get one or two falses.


tell application "Finder"
set f to item 1 of (get selection)
set a to quoted form of POSIX path of (f as Unicode text)
set b to quoted form of POSIX path of (f as file specification)
set c to quoted form of POSIX path of (f as alias)
set d to quoted form of POSIX path of (f as string)
{a = b, a = c, a = d}

--> {true, true, false}
end tell
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: quoted form of POSIX path
      • From: Jonathan Levi MD <email@hidden>
References: 
 >Re: applescript-users digest, Vol 3 #1900 - 16 msgs (From: "Jonathan Levi, M.D." <email@hidden>)

  • Prev by Date: iCal Scripting: Any Caveats?
  • Next by Date: Re: Adobe InDesign - Unlink From - how?
  • Previous by thread: Re: applescript-users digest, Vol 3 #1900 - 16 msgs
  • Next by thread: Re: quoted form of POSIX path
  • Index(es):
    • Date
    • Thread