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:17:09 +0100
OK, I figured out how to het this far:
....................................................................
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\"8" & "Open file \"" & x &
"\" as alias" & "8end tell"
....................................................................
with this (the intelligent part of it borrowed fro a JD snippet, thanks) I
can drag a file over an OmniGraffle shape, copy the resulting URL to that
file to the clipboard, run this script and paste it back as an alias.
I _only_ need to figure out how to insert 2 returns (if possible?) to
separate the tell/end tell from the "Open file" statement - I put an "8" at
these two places in the script above.
Help, anyone? (or comments if this is totally stupid)
Mike C.
PS: why not just drag the original files over a droplet or something, and
get the path then paste it in OG? - because its much easier to me to drag
them over OG first (there are many) and then, when I have the time, to run
the script to reference them as aliases. Hm, maybe I can automate the entire
thing, with dozens of shapes, each with an external file referenced as URL,
convert all to alias references at once, _before_ I start moving the
referenced files around. Just daydreaming...
_______________________________________________
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.