• 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: John Delacour <email@hidden>
  • Date: Sat, 15 Feb 2003 00:18:13 +0100
  • Mac-eudora-version: 6.0a6

At 4:17 pm -0500 14/02/03, Paul Skinner wrote:

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.


Further to my last message, here's one way to do it. There's probably an even simpler way in the shell.


set URI to "file://localhost/Applications/Address Book.app/"
set posixPath to do shell script "perl -e '
$_ = q~" & URI & "~;
s~file:/+~~;
s~localhost~~;
s~%([0-F][0-F])~chr(hex($1))~eg;
print'"
POSIX file posixPath

JD
_______________________________________________
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.

  • Follow-Ups:
    • Re: posix path conversion
      • From: David Hood <email@hidden>
References: 
 >posix path conversion (From: Paul Skinner <email@hidden>)

  • Prev by Date: Re: posix path conversion
  • Next by Date: Re: posix path conversion
  • Previous by thread: Re: posix path conversion
  • Next by thread: Re: posix path conversion
  • Index(es):
    • Date
    • Thread