Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

How can I use the built in tool, Automator (rather than a 3rd party app), to create a simple keyboard macro?

For example, I want it to press command-shift-left, then command-U, then right, etc.

I tried using the record feature to create this macro, but ran into several problems.

The first is that it's copying my mouse events after I press record and as I go into the application I want to run the macro on. For example, in this case I want to run it in Chrome. I ended up deleting the first few steps which involved launching chrome. The reason I deleted them is because I don't want it to be limited to a specific application, and I think that it just adds to the complexity if it tries activating an application. I want it to stick with running keyboard commands only.

The second problem is that I'm not sure how to initiate the keyboard macro. Do I save the recorded file? Where to? How do I invoke the macro once I am in Chrome? Is there a way to assign a keyboard shortcut to it?

share|improve this question
add comment

1 Answer 1

If you don't want to use any third party apps you are really complicating your life. Although I think it's possible.

1) Open Automator and create a new Service. In your workflow you want to Run Applescript. In there you tell it to press the keys you want. enter image description here

Once you save it as a Service you can then set up a keyboard shortcut for it in System Preferences. It shoudl automatically show up under the General group. Make sure it's enabled and give it a keyboard shortcut. enter image description here

I have gotten this to work by testing the Show history function(cmd+Y). Hopefully the above isn't too cryptic. If you want to set global shortcuts and run scripts you might want to look at BetterTouchTool : http://blog.boastr.net/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.