I am currently using this Automator AppleScript to create a service to open a URL using Chrome Canary in incognito mode
on run {input}
set theURL to input
if application "Google Chrome Canary" is running then
tell application "Google Chrome Canary" to make new window with properties {mode:"incognito"}
else
do shell script "open -a /Applications/Google\\ Chrome\\ Canary.app --args {URL:theURL} --incognito"
end if
tell application "Google Chrome Canary" to activate
end run
Google Chrome Canary will launch with a new window, but the URL does not load. What am I missing?
Thank you.
Best Answer
I do not have Google Chrome Canary installed but I do have Google Chrome installed and because you've not shown how
on run {input}
is actually receiving its input, what I'm presenting is being done in AppleScript Editor however you should be able to translate it to your use with Google Chrome Canary in Automator.The following AppleScript code examples do what it is you're trying to do albeit in Google Chrome not Google Chrome Canary however change instances of Google Chrome to Google Chrome Canary as applicable and it should work as the examples do work as tested.
This first example uses the
do shell script
command in theelse
block:Note: When used in a Run AppleScript action in Automator you may not need to use
quoted form of
withtheURL
, so the last part of thedo shell script
command will in that case just be:& theURL
This second example forgoes the use of the
do shell script
command in theelse
block: