Hi all,
New Alfred user here. I wanted a way to open a new tab, new window, and new incognito window from alfred, but couldn't find an existing workflow for new tab so I hacked one together from the 'new window' workflow I found. And I figured someone might be interested in having all 3 in a single place.
Here's a zip of the workflows for anyone interested:
https://dl.dropboxusercontent.com/u/29173129/Google%20Chrome%20Workflow%20Kit%20for%20Alfred.zip
And here is the applescript I used for each:
New Chrome Window
on alfred_script(q)
tell application "/Applications/Google Chrome.app"
make new window
activate
end tell
end alfred_script
New Chrome Tab
tell application "System Events"
set myList to (name of every process)
end tell
if (myList contains "Google Chrome") is false then
do shell script "open -a Google\\ Chrome --new --args"
else
tell application "Google Chrome"
activate
tell application "System Events" to keystroke "t" using {command down}
end tell
end if
New Incognito Window
tell application "System Events"
set myList to (name of every process)
end tell
if (myList contains "Google Chrome") is false then
do shell script "open -a Google\\ Chrome --new --args -incognito"
else
tell application "Google Chrome"
activate
tell application "System Events" to keystroke "n" using {command down, shift down}
end tell
end if