When I bought my MacBook Air it came preinstalled with lots of software but one thing was, luckily, missing: the Adobe®™ Flash player. Because I wanted to keep my Safari stable and not draining the battery I decided to keep Flash of my machine. But after a while I noticed that some site require Flash, for instance the Flickr slideshows or the Wordpress statistics, Google Analytics and the list goes on.
The first solution was easy, I already use Google Chrome as my second browser besides Safari and Chrome has it's own, stable more secure, implementation of the Flash player. So for the sites and applications that need Flash I just fired up Chrome, copied the URL from my Safari window, switched to Chrome and paste it in. Works great.
But after reading on Daring Fireball about the Applescript Mr. Gruber was using I fired up my Applescript editor and made a simple but robust script to copy the active Safari URL, open a new Chrome window if there isn't one and open a new tab with the URL. And I wanted a simple keyboard shortcut to make the whole process as easy as possible. And I didn't want to use any third party tools.
Now without external tools it isn't possible to assign a keyboard shortcut to an Applescript. But it is possible with Automator to make a service. And a service appears in the menubar and can be assigned a shortcut. And it's possible to run an Applescript from within a Automator workflow. So to begin fire up Automator. I use this great program many times to automate workflows and absolutely love it.
When Automator starts you can choose the type of document, pick Service because we want to have it appear in the service menu.
The next step is to select the "Get Current Webpage from Safari" from the Internet section in the Library. Drag it to the workflow area.
On top you have to choose "no input" and "Safari" so this service is only available in the Services list within Safari.
The next step is to select the "Run Applescript" from the Utilities section in the Library and drag this as the next step under the "Get Current Webpage from Safari".
Download the Applescript here Download the Applescript here and paste it in the window. The script will first check if there is an available Chrome window and if not make one. After that it makes a new tab with the URL of the previous step at the end of the possible existing tabs. And brings Chrome to the front.
Next save the service and pick a name that describes what the service does. Best is to copy this name to the clipboard because we need it exactly later on.
To see if everything works ok now open up Safari and go to the Services menu, there you should see the new service. Test it and it should open Chrome with the same page that was open in Safari. When this works the next step is to assign a keyboard shortcut to the service. Open up System Preferences and go to the Keyboard section and select Keyboard Shortcuts.
At the bottom of the list select "Application Shortcuts" and click the "+" sign.
In the dialog choose Safari for the Application, paste the exact name of the Automator service we created and choose a available Keyboard Shortcut. Add it and you're done.
So the next time you visit a site where Flash is needed for the full experience just hit the keyboard shortcut and Chrome will let you use the Flash version while still being more secure and stable than the Adobe Flash player and your battery will also thank you if you have a macbook [pro|air].










