Re:help converting URL to alias for OmniGraffle
Re:help converting URL to alias for OmniGraffle
- Subject: Re:help converting URL to alias for OmniGraffle
- From: Michael Cytrynowicz <email@hidden>
- Date: Sun, 16 Mar 2003 21:47:17 +0100
Done!
I searched the (blessed archives) and found the answer was, well, very
simple indeed.
so the script now is:
..................................................
set URI to the clipboard
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
set x to POSIX file posixPath
set the clipboard to "Tell application \"Finder\"" & return & "Open file \""
& x & "\" as alias" & return & "end tell"
.......................................................
will convert this in the clipboard:
file://localhost/Users/uimike/Desktop/file.jpg
to this, ready for pasting:
Tell application "Finder"
Open file "Dodecaide:Users:uimike:Desktop:file.jpg" as alias
end tell
Thanks to JD's perl/shell magic.
Mike C
_______________________________________________
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.