Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

covertsurfer

macrumors 6502a
Original poster
I think this is the correct program to use. I often copy text from a web page, press Ctrl + T then Ctrl + V and then enter to visit the url I just copied.

Is it possible to record that action and then assign a hotkey to the action?

I guess it should only run once it knows there is something in the clipboard.

Thanks
 
Here's an applescript that copies the selected text, opens a new tab, then pastes the text and presses enter. Not sure about how you're going to do that hotkey thing.
 

Attachments

dosent safari recognize most url´s and when right clicked allows you to open in it in a new tab, window etc?

You can assign a hotkey to run scripts with spark or quicksilver for instance but im not sure how pleased you will be with how it works ie the time the whole process will take
 
Thanks for the applescript! Thats amazing! Everytime I want to run that script, what are the processes involved?

Thanks again
 
The crucial point is the delay. In the version I uploaded there is none so whenever you start the app it copies etc. right away without a chance of you switching to your browser window.

You'll have to figure out how to invoke it with your browser activated. Do you use Safari?
 
I think I have it running now but I have edited it just so it has

Code:
tell application "System Events"
	keystroke "t" using {command down}
end tell

However, the window flickers or loses focus and comes back and doesn't open a new tab
 
That did it, do you have the script for it?

I've added this not sure if thats what you did
Code:
tell application "Firefox"
	activate
end tell
tell application "System Events"
	keystroke "c" using {command down}
	keystroke "t" using {command down}
	keystroke "v" using {command down}
	key code 36
end tell
 
Yea, that's what I did. Now you only have to figure out how to invoke that with a keystroke. I was thinking of creating an item in Services but somehow it doesn't work. Maybe look into Quicksilver or another launcher?
 
I've tried going to system preferences - keyboard and mouse and adding a shortcut there but it doesn't seem to work when i press the shortcut. If I got the scripts menu and run it, its fine
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.