This week’s Ask Mac Automator questions deal with Safari, an application that Keyboard Maestro and other automation programs can automate quite well.

Bakari45: I have KM check Safari each time it’s brought to the front for a specified words in a title of a webpage. It might do the same for watching for a URL string. For example, when I download a WordPress editor, KM opens a designated palette of WordPress macros.

Could you post your macro of that?

Keyboard Maestro has a powerful “If All Conditions Met Execute Actions” action. The following macro consists of the conditional action set to trigger each times Safari is activated.

If you know the name of the Safari window that you want KM to monitor, you can add that condition, and from there you can have it execute one or more actions. When the conditions are not met, the macro won’t execute, if you set it up that way.

Mac_automation_9Zp7Zk

Note: there’s also an action for getting the title of a window.

Keyboard Maestro macro

I recently removed Flash from my Mac, and have made Safari my default browser. Since some webpages will not display properly in Safari without Flash, what is the best way to automatically copy the current URL in Safari and open it in Chrome (which has a Flash workaround) either through BTT or KM?

There probably are a few other ways to address this problem, but what first came to mind for me is using Keyboard Maestro’s “Select or Show a Menu Item” action.

If you enable the Developers Menu in Safari, you can open the front most webpage in any browser.

To enable the Developers menu, open Safari Preferences > Advanced > “Show Develop menu in menu bar” at the bottom of the window.

Keyboard Maestro macro

Next set up the KM macro as shown above, and then assign a hotkey or other trigger to it. Note: the Developer menu item for Google Chrome may change (or be different from what is shown above) when Chrome is updated.

You have an Ask Mac Automator question? Post and send the question here, and if it’s useful for other readers, I will post it in this column.

Update

Brian, one of my readers and subscribers, shared his better solution to this macro. He wrote: ,”I use KM’s “Set Google Chrome URL to ‘%SafariURL%’ … With URL: “%SafariURL%” action.  No need to update it when Chrome’s version is updated.”

This solution means that you can open Google Chrome, trigger the macro, and Keyboard Maestro will insert the frontmost Safari URL in the background.

Keyboard Maestro_googleThank’s Brian. This is one of purposes of this site, to share and refine solutions.

Your Method?

Also, if you have a different solution to the above questions, please share them in the comment section below. I always look forward to hearing from you.

 

 

Bakari Chavanu

Bakari Chavanu is a freelance writer and long-time Mac users. He's written hundreds articles about Mac applications and Mac automation for general users. He's also the author of "The Awesome Guide to Mac Automation" (MakeUseOf.com).
  • I use a similar method in KBM, but mine is integrated into pop clip. So, I simply highlight the URL and I get a pop clip popup that includes “Open in chrome”.
    When I click the “open in Chrome” icon, the URL is opened in Chrome.