Re: posix path conversion
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.