help converting URL to alias for OmniGraffle
help converting URL to alias for OmniGraffle
- Subject: help converting URL to alias for OmniGraffle
- From: Michael Cytrynowicz <email@hidden>
- Date: Sun, 16 Mar 2003 12:58:14 +0100
I've been using OmniGraffle more and more, and I am using OG's ability to
drag and drop to link a shape to an external file. Unfortunately (to me)
this creates URL links:
file://localhost/Users/uimike/00-Critical/02-omnis excels am/spirit.oout
line
And these break if I move the referenced file. As a workaround, I'd like to
be able to copy the URL to the clipboard, then run a script to get it back
into the clipboard exactly as:
Open file "Users:uimike:00-Critical:02-omnis excels am:spirit.ooutline" as
alias
which I would manually paste in the "run a script" field for that shape.
This would simplify my life considerably.
...
I read several past posts from John Delacour, Michelle, paul Skinner and
others, and I started building the script like this:
..............................................
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'"
set openfileScript to "Open " & POSIX file posixPath & " as alias"
set the clipboard to openfileScript
...............................................
What I am not sure how to do is to get the "" in the right places...
Thanks for any help,
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.