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: Scott Babcock <email@hidden>
- Date: Tue, 13 Mar 2007 12:00:18 -0700
- Acceptlanguage: en-US
- Thread-topic: Encoded file URL to Mac or Posix path...
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.
-----Original Message-----
Date: Sat, 10 Mar 2007 15:47:29 +0000
From: has <email@hidden>
Subject: Re: Encoded file URL to Mac or Posix path...
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed
Emmanuel wrote:
>> Do you have plans to include 'unescapeURL' in the Satimage (or other)
>> osax?
>
> Not now.
TextCommands <http://osaxen.com/files/textcommands1.1.0.html> has a
'decode URL' command that does the same thing:
tell application "TextCommands"
decode URL "file://localhost/Users/username/Desktop/éøu
¥"
end tell
POSIX file result
--> file "d1:Users:username:Desktop:????"
HTH
has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org
http://appscript.sourceforge.net/objc-appscript.html
_______________________________________________
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