RE: Encoded file URL to Mac or Posix path...
RE: Encoded file URL to Mac or Posix path...
- Subject: RE: Encoded file URL to Mac or Posix path...
- From: "J. Stewart" <email@hidden>
- Date: Tue, 13 Mar 2007 16:33:21 -0400
On 3/13/07 at 3:00 PM, Scott Babcock <email@hidden> spake thusly:
>There's an easy way to do this without using scripting additions:
>
>set fileURI to "file://localhost/Users/username/Desktop/éøu
>¥"
>set posixPath to (do shell script "perl -e 'use URI::file; print URI->new(\"" & fileURI & "\")->file;'")
>--> "/Users/username/Desktop/????"
>
>This returns the POSIX path, which you can manipulate in all the standard ways - create a file reference, coerce
>to alias, etc.
Nudge, nudge, apparently it has slipped your mind that "do shell script" is a scripting addition command. It's in the Miscellaneous Commands suite, defined in the StandardAdditions.osax. Given that it also needs to fire up a shell instance to run the perl commands I fail to see any real advantage to using this method. Just my 2¢.
JBS
--
If you don't learn to laugh at trouble, you won't have anything to laugh at when you are old. — Will Rogers
_______________________________________________
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