Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on alfred_script(q)
- set _win to false
- tell application "Google Chrome"
- set {idList, urlList} to {id, URL} of every tab of every window
- end tell
- set AppleScript's text item delimiters to return
- if (urlList as text) contains "http://andrews-macbook-air-3.local:6006" = true then
- set theWin to 1
- repeat with i in urlList
- set theTab to 1
- repeat with n in i
- if n starts with "http://andrews-macbook-air-3.local:6006" then
- set {_win, _tab} to {theWin, theTab}
- end if
- set theTab to theTab + 1
- end repeat
- set theWin to theWin + 1
- end repeat
- end if
- if _win ≠ false then
- tell application "Google Chrome"
- activate
- tell front window to set active tab index to _tab
- end tell
- else
- tell application "Google Chrome"
- set myTab to make new tab at beginning of tabs of window 1
- set URL of myTab to "http://andrews-macbook-air-3.local:6006/#agent"
- end tell
- end if
- end alfred_script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement