• 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: Encoded file URL to Mac or Posix path...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Encoded file URL to Mac or Posix path...


  • Subject: Re: Encoded file URL to Mac or Posix path...
  • From: Emmanuel <email@hidden>
  • Date: Sat, 10 Mar 2007 15:21:27 +0100

At 4:10 AM -0600 3/10/07, Peter Bunn wrote:


Assuming a file named "éøü¥" exists on the desktop, getting a file URL
for it is useful for some purposes...

tell application "System Events"
   set target_file to "Macintosh HD:Users:username:Desktop:éøü¥" as alias
   set target_URL to URL of target_file
end tell

... returns
"file://localhost/Users/username/Desktop/éøü¥".

Anyone know how to easily coerce that back to an unencoded Mac or Posix
file path?

If you can afford working in Smile, use unescapeURL.

POSIX file (unescapeURL "file://localhost/Users/username/Desktop/éøü¥")

 --> file "emmanuel's hd30:Users:username:Desktop:éøü¥"

Emmanuel
_______________________________________________
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
References: 
 >Encoded file URL to Mac or Posix path... (From: Peter Bunn <email@hidden>)

  • Prev by Date: Re: Global variables
  • Next by Date: Re: Encoded file URL to Mac or Posix path...
  • Previous by thread: Encoded file URL to Mac or Posix path...
  • Next by thread: Re: Encoded file URL to Mac or Posix path...
  • Index(es):
    • Date
    • Thread