• 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: posix path conversion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: posix path conversion


  • Subject: Re: posix path conversion
  • From: has <email@hidden>
  • Date: Sat, 15 Feb 2003 01:41:03 +0000

Paul Skinner wrote:

I seem to vaugely recall a command for converting posix paths to
applescript paths.

You're thinking of the posix path (string) to posix file (object) coercion:

"/Applications/Address Book.app/" as posix file
--> file "Macintosh HD:Applications:Address Book.app:"


I have a path like so...

file://localhost/Applications/Address Book.app/

this is the url of a file as returned by the finder.
I'd like to convert it to an alias, path, file ref, etc.

If you're starting with the Finder, why don't you get an alias or file spec from it instead of a URL? A lot less hassle than converting urls to posix paths.

Stripping the "file://localhost" bit off is trivial. The hardest bit is decoding the hex entities as they're UTF-8, which makes it a bit more work. (I've already written a vanilla MacRoman decoder, but not one for UTF-8. Could be done though: just needs more lookup tables.) Or maybe you can find an osax or perl script to do the decoding.

has
--
http://www.barple.pwp.blueyonder.co.uk -- The Little Page of AppleScripts
_______________________________________________
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.

  • Prev by Date: List Volumes ...
  • Next by Date: Re: Q: specifying text in a variable to a color when inserting into Apple's Mail.app?
  • Previous by thread: Re: posix path conversion
  • Next by thread: Re: applescript-users digest, Vol 3 #1341 - 14 msgs
  • Index(es):
    • Date
    • Thread