Invoke Macro or Workflow with Hotkey using Automator

Joined
Sep 15, 2013
Messages
1
Reaction score
0
Having spent several hours trying to automate some simple repeated tasks, I thought I'd share what I found out--maybe saving someone else the hours of trying different apps, reading through really bad documentation....

While it's unknown why Apple goes out of its way to keep this kind of info a secret, you can use a Mac tool to create a macro (workflow) and invoke it with a hotkey.

Use Automator. You can find it in the Applications folder or in Spotlight.

You need to create a Service, to hook it up with a hotkey.

I think for a hotkey action, you'd always use "no input" for "Service receives." I also found it's safest to sue "any application." I think if you select an application, you are confined to the instance you have up---for example, I wanted to copy from one folder to another and it didn't work using "Finder" application, but it did work with "Any application." I think this may also define the scope of where your hot key works--everywhere or just in one place. Just speculating, since I can't find these answers.

I found the Record functionality didn't work very well. The best bet is if you are lucky enough to find the actions you want to perform in the list. Drag the actions over from the left panel. For mine, I went to "Files and Folders" and dragged over "Get Selected Finder Items", which means it's going to act on the finder items you have highlighted to select, and then "Copy Finder Items" which lets you enter the destination directory (when you choose "other").

To test it, go to where you want to be when you run this (in my case, a file selected in Finder) and click "Run" in the top right corner to see if it works.

When you're happy with the results, you must save from the File menu. For a service, be careful what you name it, it lets you change the name, but I found the new name doesn't show up in "Services", or maybe it takes awhile. Also, it is difficult, but not impossible to delete a service.

Now to apply hotkey, go to System Preferences / Keyboard / Keyboard Shortcuts / Services. At the bottom under General, you should see the Service you created and you can apply a hotkey.

To find the Service (to delete it), Apple has hidden those files. Use Finder. You want /users/[user name]/Library/Services. From the directory named by your user name (should be right there on favorites), If you don't see the Library folder, click the "Go" tab, "Go to Folder.." option. Library should show up when you press the 'alt' key, but if not, you can click "Go to Folder" and type in the folder you want as ~/Library and it will open up the hidden file. The Services folder is in the Library folder. You may have to type in ~/Services in the "Go to Folder" to get it to appear. Your custom Services should be there and can be deleted. A user help forum suggested you may also need to delete a cache file to get it to quit showing up in Keyboard shortcuts, but I didn't use that, so don't know much about it.
 

Attachments

  • upload_2013-9-15_9-25-41.png
    upload_2013-9-15_9-25-41.png
    108 KB · Views: 426
  • upload_2013-9-15_9-26-27.png
    upload_2013-9-15_9-26-27.png
    108 KB · Views: 377
  • upload_2013-9-15_9-27-12.png
    upload_2013-9-15_9-27-12.png
    5.7 KB · Views: 343
  • upload_2013-9-15_9-27-41.png
    upload_2013-9-15_9-27-41.png
    108 KB · Views: 327

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top