applescript to switch tabs in google chrome
im trying to create an apple script to open google chrome,open 5 tabs and goto different urls,
and then alternate the tabs.
This is what i kinda have so far im very bad at applescript.
on is_running(appName)
tell application "System Events" to (name of processes) contains appName
end is_running
set chromeRunning to is_running("Google Chrome")
if chromeRunning then
tell application "Google Chrome"
set i to 0
set j to 0
repeat with w in (windows)
set j to j + 1
repeat with t in (tabs of w)
set i to i + 1
if title of t contains "Gmail" then
set (active tab index of windowj) to i
return
end if
end repeat
end repeat
tell application "Google Chrome"
activate
open location "http://hotmail.com/"
end tell
delay 10
tell application "Google Chrome"
activate
open location "http://cnn.com/"
end tell
tell application "Google Chrome"
activate
open location "http://netflix.com/"
end tell
tell application "Google Chrome"
activate
open location "http://slashdot.com/"
end tell
tell application "Google Chrome"
activate
open location "http://hackaday.com/"
end tell
MacBook Pro with Retina display