Copy link and act on it with one click

Hi all!

I’m trying to create a script that does something with a URL, and I really want to be able to activate it by right-clicking on a link in Safari (or IE). I found OnMyCommand, which lets you add contextual menu items, but it will only work with selected text or text on the clipboard. I can right-click to Copy Link to get the URL on the clipboard and then again to use OnMyCommand (or just launch a script, assuming Applescript will access the clipboard somehow), but I’d really like to get it to one click if possible. The problem is the URL can’t be highlighted unless I first follow it to the subpage, because the text of the link is just the name of the subpage.

Anyone have any ideas of how to do this, or if it is possible?

Thanks!

-Talix

Get it from the status bar

activate application "Safari"
tell application "System Events"
	tell process "Safari"
		delay 3 -- give you 3 seconds to get over your link
		set a to value of static text 1 of group 1 of window 1
	end tell
end tell

Of course its got to be open, and you would have to remove ‘goto’ and ending quotemark

That’s an awesome idea! I’ll give it a shot when I have some time and get back to you.

Thanks!

-Talix