How to save a script as a keyboard shortcut for terminal?

Hi apple community,


I'm trying to make a few different scripts using cliclick to make clicking in certain areas at a press of a shortcut command.


Once I make a script..."cliclick c:28,11 w:500 m:+0,+24 w:1000 kd:alt w:1000 c:. ku:alt" in terminal for example...


How would I go about saving the script to create a keyboard shortcut command?


Thank you in advance.

Mac OS X (10.6.8)

Posted on Aug 15, 2014 2:04 PM

Reply
3 replies

Aug 15, 2014 3:21 PM in response to BobHarris

Wel,l i'm trying to create a command that will click the mouse at a specified spot in the screen by typing a keyboard shortcut command.


For example, I want the mouse to click a button at location: 514, 279 on the screen whenever I type the command "option + 1"


I can get cliclick to do the clicking, but thats only if I type the command and then press enter. I want to find a way to save that command, then place a shortcut like "option + 1" to begin action.


Would I achieve this through shell alias?

Aug 15, 2014 5:25 PM in response to JZoSoPP

You want that kind of keyboard shortcut (aka a Hotkey). Those kind of keyboard shortcuts are not a Terminal concept. The terminal is for typing commands, and a shortcut for a command is a shorter string of characters to type followed by a carriage return. Not a key combination that launches a command.


You most likely need to write an Applescript or Automator app that includes your cliclick command. Then use System Preferences -> Keyboard -> Shortcuts to associate a key combination with running your Applescript or Automator app.


Or use a hotkey utility to map your key combination to running your Applescript or Automator app.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to save a script as a keyboard shortcut for terminal?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.