MACRO or PLUGIN: Open or Refresh a URL in a Tab (Safari & Chrome)
REQUIRES: OS/X Yosemite or later.
UPDATE: Version 1.1.
- Now treats "http" and "https" the same, when trying to match URLs.
- Always select the active tab first, if it matches.
- Fix for issue with multiple browser windows open.
As an experiment in ease-of-use, I've provided a Plugin version, and a Macro version. It's your choice which to use. See the Installation Instructions below for more information.
MACRO - Open or Refresh a URL in a Tab (Sub-Macro).v1.1.kmmacros (36.2 KB)
PLUGIN - Open or Refresh a URL in a Tab (Sub-Macro).v1.1.zip (9.2 KB)
PURPOSE:
Open a URL in a Safari or Chrome tab. If the URL is already open in a tab, then that tab is selected, and optionally, reloaded.
When determining if the URL us already open in a tab, you can choose to have the URL match exactly, or only the start of the URL has to match.
USAGE:
Plugin
Macro
Execute this macro using "with parameter", and pass the parameters (separated by a pipe |
character).
NOTES:
- If the browser isn't running, it will be launched.
- If the browser does not have a window, a new window will be created.
- When opening the URL, the browser will become the front application.
- If multiple tabs match the URL, then the first tab encountered is the one that is used.
Which Should You Use - Plugin or Macro?
Whichever you prefer.
- The Plugin is easier to use, since the parameters have individual editors.
- The Plugin can't be "synced" between computers - it has to be installed on each computer you wish to use it on.
- When installing an update, it's a teensy-bit more work to install the updated Plugin than it is to import the updated Macro.
Which do I personally use?
I use the plugin, because it's easier to enter the parameters. And it's cooler.
INSTALLATION INSTRUCTIONS
MACRO:
Import the .kmmacros file in the link at the start of this post.
If you're installing an updated version, I recommend you delete the old macro first. Your existing macros will continue to function as before.
PLUGIN:
First-time install:
- Download the .zip file in the link at the start of this post.
- Drag the zip file and drop it on the Keyboard Maestro Editor icon in the Dock.
Installing an Updated Plugin:
A) Remove Existing Plugin Folder:
- In the Keyboard Maestro Editor, click the menu
Help->Open Preferences Folder
. - In the Finder window that opens, navigate to the folder "Keyboard Maestro Actions".
- Move the existing folder "Open or Refresh a URL in a Tab" to the trash.
B) Restart the Keyboard Maestro Engine:
- Back in the Editor, stop and start the Engine:
File->Quit Engine
File->Start Engine
C) Install the New Plugin, same as first-time install:
- Download the .zip file in the link at the start of this post.
- Drag the zip file and drop it on the Keyboard Maestro Editor icon in the Dock.