Triggers are great for summoning apps – if an app is not running, it launches, and if it is running, it activates. However, services such as Feedly provide their… services in web apps. A trigger to open a service’s URL can result in multiple duplicate tabs cluttering up the default browser.
To reduce tab-closing chores, the following script activates or, if necessary, opens a Feedly tab in the frontmost Chrome window:
tell application "Google Chrome" activate try tell window 1 set _tabs to tabs set _tabNumber to 0 repeat with _tab in _tabs set _tabNumber to _tabNumber + 1 if URL of _tab contains "http://www.feedly.com/" then set URL of _tab to¬ "http://www.feedly.com/home#my" set active tab index to _tabNumber return end if end repeat end tell end try -- If no tabs contain the parent URL: open location "http://www.feedly.com/home#my" activate end tell
No need to save the script – just grab it into Quicksilver, set ‘Run as AppleScript’ in pane 2, and hit ⌃⏎ to find the ‘Add Trigger…’ action.
Control-enter displays the command based actions such as ‘Add Trigger…’
The script can be modified to accommodate almost any URL.