How to create keyboard shortcuts to launch apps in macOS using Automator

Posted:
in macOS edited October 2020
While macOS allows users to create their own keyboard shortcuts to perform functions in apps, there isn't a built-in way to launch the apps themselves using a similar maneuver. AppleInsider shows you one way to create app-launching keyboard shortcuts, using the included Automator utility.




Apple included a fairly simple way to create custom keyboard shortcuts within System Preferences, which can easily be used to produce shortcut combinations for app functions that do not already have one defined. While the Shortcuts settings also enables various other system functions to run, the extensive list simply doesn't have an option to run a user-defined app.

This doesn't mean it is impossible to launch an app by creating a shortcut, but handily it is possible to trigger something else that in turn can load an app. In this case, we will be creating a keyboard shortcut to trigger an Automator-produced event, which will open up the selected app.

Using Automator

First, we need to create an Automator service that, when prompted, will open our selected application.

Open Automator. It can be found in the Applications folder, accessible by selecting Go then Applications in the Finder menu or by using the keyboard shortcut Shift Command A.



If this is your first time in Automator, you should be presented by an initial window offering to start a new document, though if it doesn't appear, select File then New in the menu to start from scratch. At this point, select Service then the Choose button.




In the top section starting "Service receives," set the dropdown box to "no input," and check to make sure the second dropdown is set to "any application."



Click Actions in the top-right corner, scroll down the list of actions in the second column to find Launch Application, and drag it into the main workflow box to the right. This will add a new Launch Application section to the workflow box.




Select the application you want to open from the shortcut using the Launch Application dropdown box.



Select File then Save in the menu, enter an appropriate name for the command, and click Save. Close Automator.

Creating the shortcut

Select the Apple logo in the Menu, and select System Preferences then the Keyboard icon in the second row. Select the Shortcuts tab, which should be in the middle of the five tabs near the top of the window.



Select Services in the left-hand column, then scroll down to the service with the same name as the command created in Automator. If the side tick isn't visible, click it before clicking the command, then click the Add Shortcut button that appears.




At this point, select the key combination you want to use to open the selected application and press the buttons at the same time. If macOS accepts the combination, it will then show the keyboard combination in the listing.




Close the System Preferences window and test out the keyboard command.


Further Thoughts

While this tip largely centers around opening an app, the same principles can be used to create keyboard shortcuts to do a multitude of tasks. If a sequence of events is set up in Automator and saved as a service, it can be assigned a keyboard shortcut, and could be used to perform multi-stage tasks with a single collective key press.

Also, be aware of setting a keyboard shortcut that may duplicate one that is already in use by another system function or app, in case they conflict with each other or fail to perform an action at all. The last thing you want is to go to the trouble of setting up a key combination that ultimately doesn't do what you want.
«1

Comments

  • Reply 1 of 26
    macxpressmacxpress Posts: 5,801member
    Ugh Automator....one of the most frustrating and unintuitive apps in macOS. 
    jony0
  • Reply 2 of 26
    JanNLJanNL Posts: 327member
    Ah, keyboard shortcuts remember me of the Quickeys times... on an Apple Extended Keyboard II  :)
    jony0
  • Reply 3 of 26
    SoliSoli Posts: 10,035member
    macxpress said:
    Ugh Automator....one of the most frustrating and unintuitive apps in macOS. 
    How so? It's not better than a dedicated app and it's not something I'd recommend for the average user, but it sure does make quick work of solving problems over using AppleScript.
  • Reply 4 of 26

    Years ago, when Apple introduced OX X, Gruber provided how to articles to help noobs get comfortable with the new OS... they were invaluable!  Lately tho, Gruber has become less technical and more political...

    Now, I appreciate these How To articles on AI...  Keep 'em coming!

    IMO, the popular fast-evolving Swift language is a goldmine waiting to be mined for how to articles.


  • Reply 5 of 26
    Soli said:
    macxpress said:
    Ugh Automator....one of the most frustrating and unintuitive apps in macOS. 
    How so? It's not better than a dedicated app and it's not something I'd recommend for the average user, but it sure does make quick work of solving problems over using AppleScript.
    Yeah, but...

    Automator hasn't been upgraded recently & the web site is not an Apple site -- it belongs to the Automator Guru who used to work for Apple.



    Oddly, the Provide Automator Feedback still goes thru the Apple Site


    edited March 2018
  • Reply 6 of 26
    avon b7avon b7 Posts: 7,621member

    Years ago, when Apple introduced OX X, Gruber provided how to articles to help noobs get comfortable with the new OS... they were invaluable!  Lately tho, Gruber has become less technical and more political...

    Now, I appreciate these How To articles on AI...  Keep 'em coming!

    IMO, the popular fast-evolving Swift language is a goldmine waiting to be mined for how to articles.


    I second this. ''how to's' are worth their weight in gold for learning and finding solutions to one-off problems.

    AppleScript was one of the great Apple inventions.
  • Reply 7 of 26
    SoliSoli Posts: 10,035member
    Soli said:
    macxpress said:
    Ugh Automator....one of the most frustrating and unintuitive apps in macOS. 
    How so? It's not better than a dedicated app and it's not something I'd recommend for the average user, but it sure does make quick work of solving problems over using AppleScript.
    Yeah, but...

    Automator hasn't been upgraded recently & the web site is not an Apple site -- it belongs to the Automator Guru who used to work for Apple.
    [images]
    But it's still an Apple app that's included with macOS and there are countless aspects that are much easier than trying to teach someone to use AppleScript.

    BTW, there are a lot of macOS applications included with  macOS that weren't updated with the 2017 release of High Sierra. There are even more when you look at the included apps that only have a 2017 date despite macOS point updates in 2018. Not updating an app just update an app doesn't mean it's being deprecated. What features in Automator are you looking for that should've been added because of changes between Sierra and High Sierra?
  • Reply 8 of 26
    Soli said:
    Soli said:
    macxpress said:
    Ugh Automator....one of the most frustrating and unintuitive apps in macOS. 
    How so? It's not better than a dedicated app and it's not something I'd recommend for the average user, but it sure does make quick work of solving problems over using AppleScript.
    Yeah, but...

    Automator hasn't been upgraded recently & the web site is not an Apple site -- it belongs to the Automator Guru who used to work for Apple.
    [images]
    But it's still an Apple app that's included with macOS and there are countless aspects that are much easier than trying to teach someone to use AppleScript.

    BTW, there are a lot of macOS applications included with  macOS that weren't updated with the 2017 release of High Sierra. There are even more when you look at the included apps that only have a 2017 date despite macOS point updates in 2018. Not updating an app just update an app doesn't mean it's being deprecated. What features in Automator are you looking for that should've been added because of changes between Sierra and High Sierra?
    I would like to see Swift as an option for a Automator Shell Script:


    Rayz2016
  • Reply 9 of 26
    SoliSoli Posts: 10,035member
    Soli said:
    Soli said:
    macxpress said:
    Ugh Automator....one of the most frustrating and unintuitive apps in macOS. 
    How so? It's not better than a dedicated app and it's not something I'd recommend for the average user, but it sure does make quick work of solving problems over using AppleScript.
    Yeah, but...

    Automator hasn't been upgraded recently & the web site is not an Apple site -- it belongs to the Automator Guru who used to work for Apple.
    [images]
    But it's still an Apple app that's included with macOS and there are countless aspects that are much easier than trying to teach someone to use AppleScript.

    BTW, there are a lot of macOS applications included with  macOS that weren't updated with the 2017 release of High Sierra. There are even more when you look at the included apps that only have a 2017 date despite macOS point updates in 2018. Not updating an app just update an app doesn't mean it's being deprecated. What features in Automator are you looking for that should've been added because of changes between Sierra and High Sierra?
    I would like to see Swift as an option for a Automator Shell Script:

    [image]
    Is that going to happen since Objective C has never been an option for Automator. From your screenshot, it looks like only scripting languages are supported, which makes sense.
  • Reply 10 of 26
    Soli said:
    Soli said:
    Soli said:
    macxpress said:
    Ugh Automator....one of the most frustrating and unintuitive apps in macOS. 
    How so? It's not better than a dedicated app and it's not something I'd recommend for the average user, but it sure does make quick work of solving problems over using AppleScript.
    Yeah, but...

    Automator hasn't been upgraded recently & the web site is not an Apple site -- it belongs to the Automator Guru who used to work for Apple.
    [images]
    But it's still an Apple app that's included with macOS and there are countless aspects that are much easier than trying to teach someone to use AppleScript.

    BTW, there are a lot of macOS applications included with  macOS that weren't updated with the 2017 release of High Sierra. There are even more when you look at the included apps that only have a 2017 date despite macOS point updates in 2018. Not updating an app just update an app doesn't mean it's being deprecated. What features in Automator are you looking for that should've been added because of changes between Sierra and High Sierra?
    I would like to see Swift as an option for a Automator Shell Script:

    [image]
    Is that going to happen since Objective C has never been an option for Automator. From your screenshot, it looks like only scripting languages are supported, which makes sense.
    Swift is a Scripting language (as well as an app development language, System programming language, Server Application language).

    FWIW, Here's a Swift Playground, that:

    1. writes a Swift shell script File
    2. makes it executable 
    3. runs it

    Rayz2016
  • Reply 11 of 26
    SoliSoli Posts: 10,035member
    Soli said:
    Soli said:
    Soli said:
    macxpress said:
    Ugh Automator....one of the most frustrating and unintuitive apps in macOS. 
    How so? It's not better than a dedicated app and it's not something I'd recommend for the average user, but it sure does make quick work of solving problems over using AppleScript.
    Yeah, but...

    Automator hasn't been upgraded recently & the web site is not an Apple site -- it belongs to the Automator Guru who used to work for Apple.
    [images]
    But it's still an Apple app that's included with macOS and there are countless aspects that are much easier than trying to teach someone to use AppleScript.

    BTW, there are a lot of macOS applications included with  macOS that weren't updated with the 2017 release of High Sierra. There are even more when you look at the included apps that only have a 2017 date despite macOS point updates in 2018. Not updating an app just update an app doesn't mean it's being deprecated. What features in Automator are you looking for that should've been added because of changes between Sierra and High Sierra?
    I would like to see Swift as an option for a Automator Shell Script:

    [image]
    Is that going to happen since Objective C has never been an option for Automator. From your screenshot, it looks like only scripting languages are supported, which makes sense.
    Swift is a Scripting language (as well as an app development language, System programming language, Server Application language).

    FWIW, Here's a Swift Playground, that:
    1. writes a Swift shell script File
    2. makes it executable 
    3. runs it
    [image]
    I also found this which goes over scripting in Swift. That said, it looks like it's just running in the command line using a BASH shell, so is that not possible now with Automator?

    edited March 2018
  • Reply 12 of 26
    Soli said:

    I also found this which goes over scripting in Swift. That said, it looks like it's just running in the command line using a BASH shell, so is that not possible now with Automator?


    That' a pretty old page -- June 30, 2015...

    He was using Swift 1.2 -- that's baby Swift (notice the println) -- were on Swift 4.x now and open sourced.



    That is not a bash script!  The shebang in line 1 identifies it as a Swift script.

    You could call a bash script which then invoked the Swift script -- but that's just busy work.


    The reason I think this is so important is this:

    If you've ever done a server-side install of an app, even simple apps require downloads and installs of multiple supporter apps and packages -- each with their own prerequisite downloads and installs.  This is a very long, fiddly, cryptic, error-prone, interactive process... if you're on your toes, and know enough about CLI scripts you can:

    1. detect errors
    2. determine the cause
    3. determine the recovery action required
    4. perform that action
    5. rinse and repeat

    Kinda' reminds one of a Windows install in the late 1990s...


    Swift offers the potential of a great improvement as the Swift scripts:

    1. are [non-CLI expert] human-readable as well as machine-executable
    2. are better able to detect errors, determine the cause,  determine the recovery action and perform that action
    3. offer improved probability of a successful installation
    4. allow the user to concentrate on the results (the app) rather than the complex esoteric  installation process
    5. require less user-interaction baby-sitting the installation process

    edited March 2018 Rayz2016
  • Reply 13 of 26
    fastasleepfastasleep Posts: 6,408member
    This seems like a lot of work when you can just use Spotlight and the first couple letters to launch any app. 
  • Reply 14 of 26
    This seems like a lot of work when you can just use Spotlight and the first couple letters to launch any app. 
    Spotlight works for apps that already exist on your computer...

    But if you need to install an app that doesn't  exist on your computer that involves a series of processes. that:
    1. download some data from the server that is used as input to another process that
    2. downloads some other data from the sever that installs multiple pieces (executable apps, command and data files) all over your computer
    3. rinse and repeat many times
    There are low-level constructs built into every Unix OS system called shell scripts and shell commands that allow the OS system to install and update itself.  macOS is a Unix OS.  

    When you install or upgrade macOS it runs a package that contains many low-level constructs, data, and processes -- it's a high-level package that runs a lot of low-level stuff under the covers.  The people who wrote that package have meticulously packaged the low-level stuff so you don't need to involve yourself or baby-sit the long, complicated process.

  • Reply 15 of 26
    fastasleepfastasleep Posts: 6,408member
    This seems like a lot of work when you can just use Spotlight and the first couple letters to launch any app. 
    Spotlight works for apps that already exist on your computer...

    But if you need to install an app that doesn't  exist on your computer that involves a series of processes. that:
    1. download some data from the server that is used as input to another process that
    2. downloads some other data from the sever that installs multiple pieces (executable apps, command and data files) all over your computer
    3. rinse and repeat many times
    There are low-level constructs built into every Unix OS system called shell scripts and shell commands that allow the OS system to install and update itself.  macOS is a Unix OS.  

    When you install or upgrade macOS it runs a package that contains many low-level constructs, data, and processes -- it's a high-level package that runs a lot of low-level stuff under the covers.  The people who wrote that package have meticulously packaged the low-level stuff so you don't need to involve yourself or baby-sit the long, complicated process.

    What on Earth are you blathering about?

  • Reply 16 of 26
    fastasleep said:

    What on Earth are you blathering about?

    There's a whole world out there beyond the apps on your Mac.  You may have heard of it -- it's called the Internet or World Wide Web, or more recently the Cloud.

    Many developers write apps that run in the Cloud and are accessible from a web browser or from an app on your computer, tablet, TV Controller, smart speaker, smart phone, watch, etc.  The web browser or device app provides a user interface to the Cloud app which does the heavy lifting.

    One of the Cloud apps that is becoming popular is IBM's Watson, an AI app (and much more).  You may have seen recent TV adds for Watson -- recommending maintenance for an elevator or an airplane.

    A developer who wants to access Watson, goes through a series of installation processes on IBM's servers before he can even access Watson from a browser or device app.

    One of the simple apps that a developer will, likely, install is IBM's web server app called Kitura -- because Kitura provides easy access to the Watson backend


    Here's the IBM web page on Kitura:

    .


    and here's the simple install process * for you to perform:






    Your 3 minutes start now!  Let us know how it turns out!

    * there's no simple install process accessible from Spotlight, but there could be -- that's what I'm blathering about!
    edited March 2018
  • Reply 17 of 26
    fastasleepfastasleep Posts: 6,408member
    fastasleep said:

    What on Earth are you blathering about?

    There's a whole world out there beyond the apps on your Mac.  You may have heard of it -- it's called the Internet or World Wide Web, or more recently the Cloud.

    Many developers write apps that run in the Cloud and are accessible from a web browser or from an app on your computer, tablet, TV Controller, smart speaker, smart phone, watch, etc.  The web browser or device app provides a user interface to the Cloud app which does the heavy lifting.

    One of the Cloud apps that is becoming popular is IBM's Watson, an AI app (and much more).  You may have seen recent TV adds for Watson -- recommending maintenance for an elevator or an airplane.

    A developer who wants to access Watson, goes through a series of installation processes on IBM's servers before he can even access Watson from a browser or device app.

    One of the simple apps that a developer will, likely, install is IBM's web server app called Kitura -- because Kitura provides easy access to the Watson backend


    Here's the IBM web page on Kitura:

    .


    and here's the simple install process * for you to perform:






    Your 3 minutes start now!  Let us know how it turns out!

    * there's no simple install process accessible from Spotlight, but there could be -- that's what I'm blathering about!
    I think you’re in the wrong thread. This one is about simply launching an executable .app on your Mac. You’re talking about... something else. 
  • Reply 18 of 26
    fastasleep said:
    I think you’re in the wrong thread. This one is about simply launching an executable .app on your Mac. You’re talking about... something else. 

    AppleInsider said:

    How to create keyboard shortcuts to launch apps in macOS using Automator

    Further Thoughts
    While this tip largely centers around opening an app, the same principles can be used to create keyboard shortcuts to do a multitude of tasks. If a sequence of events is set up in Automator and saved as a service, it can be assigned a keyboard shortcut, and could be used to perform multi-stage tasks with a single collective key press. 
    Automator is a scripting application with a GUI.

    The Further Thoughts paragraph suggests using the scripting technique shown to write more complex tasks.

    Thread comments #1 and #3 opened up a more general discussion of scripting (good or bad) with Automator vs it's predecessor AppleScript. Most of the ensuing posts on this thread were discussing scripting

    In post #8 I said: I would like to see Swift as an option for a Automator Shell Script.  

    I thought it odd that Automator supports 
    shell scripts written in Perl, Python and Ruby -- and not support Swift shell scripts -- as Swift was developed by Apple and is a very popular language.  I thought the ability to write Swift Shell Scripts would enhance appeal of Automator.

    FWIW, Most Apple apps and quit a few 3rd-party apps are written so that you modify the way an app works to customize output (they have a built-in scripting dictionary/library).

    Also an Automator script can have multiple segments -- the one the author showed just launched an app with a kb shortcut... It was left to the imagination of the reader to consider the possibilities of writing scripts to automate multi-stage tasks.


    Then you post:
    fastasleep said:
    This seems like a lot of work when you can just use Spotlight and the first couple letters to launch any app.

    IMO, this was OT to the subject of the article and the discussion that followed:  automating tasks with scripting.

    When I replied: Spotlight works for apps that already exist on your computer... and gave examples...

    You accused me of blathering and suggest that I am on the wrong thread.  

    Maybe I am -- I thought it was a discussion of automating tasks with scripts.
    edited March 2018
  • Reply 19 of 26
    fastasleepfastasleep Posts: 6,408member

    You accused me of blathering and suggest that I am on the wrong thread.  

    Maybe I am -- I thought it was a discussion of automating tasks with scripts.

    I was replying to the actual article on the original topic as specified in the title, which should be pretty obvious by now. Just because my comment came after your discussion doesn't mean I was replying to all replies previous to mine, so your response comes as as total non-sequitur to me. I know what Automator and AppleScript is, I've written several types of scripts to be Services triggered by a hotkey. 
  • Reply 20 of 26
    This seems like a lot of work when you can just use Spotlight and the first couple letters to launch any app. 
    Spotlight works for apps that already exist on your computer...

    But if you need to install an app that doesn't  exist on your computer that involves a series of processes. that:
    1. download some data from the server that is used as input to another process that
    2. downloads some other data from the sever that installs multiple pieces (executable apps, command and data files) all over your computer
    3. rinse and repeat many times
    There are low-level constructs built into every Unix OS system called shell scripts and shell commands that allow the OS system to install and update itself.  macOS is a Unix OS.  

    When you install or upgrade macOS it runs a package that contains many low-level constructs, data, and processes -- it's a high-level package that runs a lot of low-level stuff under the covers.  The people who wrote that package have meticulously packaged the low-level stuff so you don't need to involve yourself or baby-sit the long, complicated process.

    What on Earth are you blathering about?

    Kinda' looks like you were targeting me, no?

Sign In or Register to comment.