Automatically Change Your Desktop Image When A Specified Application Launches

Changing your desktop image can be hassle, but it doesn’t have to be if you know how to use Keyboard Maestro and Apple’s Automator.

While Mac OS X offers Spaces for quickly switching between desktops, I find Spaces a little cumbersome and impractical, especially since I work with a 27 inch iMac and a second monitor. Instead, I use an Automator workflow to quickly change between the two desktop images I use on a regular basis. I also issue a Dragon Dictate voice command to change from within any application, and I use an application trigger to make the desktop image change.

This tutorial is also about how to use Keyboard Maestro application trigger for other purposes, and how to use Automator.

 

The Automator Workflow

To  automate the desktop image change, you need to create an Automator workflow. Open Automator and select the Workflow document.

  1. Select Files  & Folders in the  Actions library.
  2. Drag the Get Specified Finder Items action to the workflow space.
  3. Click on the Add… button and locate the desktop image you want to the workflow to open and switch to. The default images can be found in your Pictures > Desktop Images folder. Make sure that the image you choose will be there when the workflow runs.
  4. Scroll down the actions and add the Set the  Desktop Picture action into the workflow. Click the Run button to test the workflow.

Now save the workflow as either a workflow or as an application format. If you save it as application, you can, for example, put the application in the Applications folder and drag it to the Dock in order to run it. Save it as workflow if you want to use it in a Keyboard Maestro macro, as will I explain next.

workflow

Keyboard Maestro Workflow

Create a new workflow in KM.

Add the Execute Automator Workflow action. Click on the purple folder and locate the Automator workflow you just saved in your Applications folder. Make sure that wherever you saved it, that KM can access it when the workflow runs.

You can use  any appropriate trigger (e.g., hotkey, stringer trigger) you like to run this workflow, but for this particular macro I use the application trigger, which means that when ScreenFlow launches, it changes to the desktop image I want to use for ScreenFlow recordings.

When I’m done using ScreenFlow, I have another workflow and macro that change the image back to the desktop image  I normally use. The macro triggers the change when ScreenFlow quits . So essentially I have two Automator workflows and two KM macros for the entire process.

Keyboard Maestro - Keyboard Maestro Editor -  Aug 15 2015 6.17.01 PM

Voice Command Trigger

Sometimes I need to change the desktop for other purposes. In such cases I can simply issue a voice command to run the KM macros, which are mapped to a Dragon Dictate voice command action. The commands are “desktop 1” for the Lakeside image, and “desktop 2” for the Apple galaxy image. Both commands are easy to remember, even when I don’t use them much.

Dragon Dictate - Dictate Status Window -  Aug 15 2015 6.25.26 PM

 

Conclusion

I hope this tutorial made sense to you, and that even if you don’t need to change your desktop image, you might be able to use the  workflow actions for other types of automations.

Let me know what you think of the Keyboard Maestro automation trigger feature and how you use it on your Mac.

 

>
GET ACCESS TO SUBSCRIBERS-ONLY  Mac Automation Resource Library
x
%d bloggers like this: