public
Last active

some AppleScript gists to open a new tab for web search

  • Download Gist
AppleScript Googlers
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
BEST (pops up a dialog to enter a search term and then opens that google search in a new tab in whatever browser is default):
 
set gSearch to the text returned of (display dialog "Google:" default answer "")
set gSearch to "http://www.google.com/search?q=" & gSearch
tell application "System Events" to open location gSearch
 
Safari:
tell application "Safari"
tell front window to set current tab to make new tab
activate
end tell
tell application "System Events" to key code 3 using {command down, option down}
 
Chrome:
tell application "Google Chrome"
tell front window to make new tab
activate
end tell
 
Firefox:
tell application "System Events"
tell application "Firefox" to activate
keystroke "t" using command down
key code 3 using {command down, option down}
end tell

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.