Spent a bit of time today troubleshooting an Automator workflow that displays web pages.
The problem had two issues.
- An error message appearing every time I pressed the keyboard shortcut I assigned it.
- Not all the web pages I specified would appear.
The commands given to the Automator workflow were to Get Specified URLs > Display Webpages. That seemed to work for a while until it didn’t.
I tried changing the settings on that Automator workflow and continued to get the same issues. Finally, I decided to try this with a shell script. I don’t really make use of shell scripts much or at all but figured I’d try it out. The idea or problem I’m trying to solve is to open nine specific websites that I want. Thats it, simply open up these 9 websites when I press this keyboard shortcut.
This is the shell script:
#!/bin/sh open "http://earthsky.org/tonight" open "http://daringfireball.net" open "http://www.loopinsight.com" open "http://kottke.org" open "http://thesweetsetup.com" open "http://thesweethome.com/" open "http://thewirecutter.com" open "http://webplatformdaily.org" open "http://instapaper.com/u"
I’ll continue to use Automator application to run this shell script and convert it to an application that I can then assign a keyboard shortcut to.
- Open Automator.
- Choose Workflow.
- Enter “Run Shell Script” on the Automator search field.
- On the Shell drop down menu choose the “/bin/bash” if your using Bash. Bash is the default OS X shell language.
- Leave Pass input drop down menu default “to stdin”.
- Add the shell script into the empty field.
- Click the Run button.
- Make sure it works like you want.
- Save the Automator workflow to application.
- On the window prompt change the File Format to Application.
- Save it to your Applications folder or wherever you prefer.
- Open up System Preferences > Keyboard > Shortcut (tab) > App Shortcuts (right column).
- Click the + (add) button and find the Automator app you just created and select it.
- Name the shortcut on Menu Title.
- On Keyboard Shortcut enter the keyboard shortcut you wish to use to call the Automator app you created.