4

I am trying to use Spotlight as a way to solely launch my most used applications.

A lot of them have similar names, so for me Spotlight displaying in a linear down list works much better then lets say Launchpad which displays them in something like a column/row combination.

Anyways I am trying to both speed up Spotlight and prevent it from displaying false positives by hiding everything but applications.

I did this by effectively unchecking everything but Applications in System Preferences → Spotlight → Search Results, and then by preventing indexing of my home folder directly.

The problem is now I can't search my Mac for anything. This solved 1 issue while creating another.

Is there a way to feasible make Spotlight search only applications while everything else search globally?

9
  • and it has to be with Cmd+Space
    – Ruskes
    Sep 11, 2018 at 1:03
  • @Buscar웃 hmm any keyboard shortcut would work fine. I mean they can always be reassigned.
    – William
    Sep 11, 2018 at 1:04
  • so something that shows you most recently used Apps ? and the Apple Menu is not it
    – Ruskes
    Sep 11, 2018 at 1:05
  • @Buscar웃 Yes. If I could dream Recently used. Alphabet list and searchable for Applications. I would like it to work most similar to sigh the windows dock as possible, but right now I have found and I am using alfred. It works okay but I really dislike the font size and have it display in the center screen instead I don't know in a corner or side of the screen. Related question I have asked softwarerecs.stackexchange.com/questions/52095/…
    – William
    Sep 11, 2018 at 1:06
  • and the Apple menu is not it ? it shows recent apps and documents
    – Ruskes
    Sep 11, 2018 at 1:09

3 Answers 3

4

The following is in response to conversation in comments with the OP.

With the Applications folder already added to the Dock and View content as set to List...

The following process will allow the Applications Dock Tile to be programmatically clicked with a keyboard shortcut as an Automator service. It requires an AppleScript application and the Automator service. This is done this way so as to avoid having to add every app that has focus when pressing the assigned keyboard shortcut of having to be explicitly granted Accessibility Access. Only the AppleScript application will need permission.

First create the AppleScript application...

In Script Editor add the following AppleScript code to a new document and save it as File Format: Application, e.g.: Click Applications Dock Tile

tell application "System Events"
    click UI element "Applications" of list 1 of application process "Dock"
end tell

Add the AppleScript application, e.g. Click Applications Dock Tile, to Accessibility in...

  • System Preferences > Security & Privacy > Privacy > Accessibility

Now create the Automator service...

In Automator:

  1. File > New, or press: ⌘N
  2. Select Service and click the Choose button.
  3. Set the settings as shown in the first image below.
  4. Add a Launch Application action.
  5. Save as e.g.: Click Applications Dock Tile

Click Applications Dock Tile Automator Service

In System Preferences...

  • System Preferences > Keyboard > Shortcuts > Services add ⇧⌘Space (press Shift-Command-Space) to the Click Applications Dock Tile service, as shown in the image below.

    • Note: A word about the shortcut you assign... ⇧⌘Space is offered as a suggestion however, you'll need to select one that doesn't conflict with any app that has focus when pressed. This may require a strange combination or a four character combo. YMMV

Services Shortcuts


Now when pressing the set key combo, the Applications Dock Tile will be clicked and you can then type one, two or three letters, as necessary together, to highlight the target app and then press Enter to open it.


Another approach is to setup a folder with aliases to just the core group of regularly used apps, adding it to the Dock and modifying the steps as appropriate. Or use the following example AppleScript code to create a dialog box that will appear mid-center screen to choose from:

set myAppList to {"Calculator", "Calendar", "Contacts", "Dictionary", "DVD Player", "Firefox", "Safari"}
choose from list myAppList
if (count result) > 0 then
    set appToOpen to item 1 of result
    do shell script "open -a " & quoted form of appToOpen
end if

Just change the app names in the myAppList list to the core group of regularly used apps. The apps shown are just to show what it would look like. BTW If you use this as an app, add an activate command before the choose from list command.

You can type one, two or three letters, as necessary together, to highlight the target app and then press Enter to open it. Or use down or up arrow or click and press Enter or click OK or double click the target. Lots of options.

choose from list dialog box


As a side note, if you use a program like FastScripts, you only need to create the AppleScript code as a .scpt not an .app and can assigned the keyboard shortcut in the Preferences for FastScripts. None of the other instructions apply unless you want to do it all natively without the use of third-party software.

Note that I am not affiliated with the developer of FastScripts, just a satisfied user.

8
  • In your first technique it would be nice if the shortcut opened and closed the menu so if you press it once it opens and press it a second time it closes it.
    – William
    Sep 11, 2018 at 15:39
  • @William, You can simply press the Esc key to dismiss the menu if you choose not to open an app after initially pressing ⇧⌘Space (or whatever key combo you've assigned). Unfortunately because of the nature of how this has to trigger the service and run a secondary application it's not conducive to trapping the initial key sequence a second time to work in the same manner as Spotlight does. This answer was just to provide some alternative workarounds, it's not perfect but what workarounds are. Sep 11, 2018 at 15:59
  • I like this answer the most because it doesn't require a 3rd party application. I have not had time to mess with it yet but I think it may be possible to detect if the application is currently open to decide if it should run the command again or close the application.
    – William
    Sep 15, 2018 at 20:16
  • Before I mark this as an answer, I'm curious if there is any way maybe using Autohotkey to speed up the opening of the list. Although it certainly works it seems to sometimes have some serious lag in just opening the service application.
    – William
    Sep 15, 2018 at 23:52
  • @William It is my understanding, and could be wrong, that AutoHotkey is a Windows app not an macOS app however, as a result of changes made to OS X/macOS in the last 3 or 4 major releases regarding UI Scripting and Security this solution of using Automator to launch another app that the app being launched only having to be added to Security & Privacy ... is the best way to do things globally and natively, and why I switched to using FastScripts for the things I used an Automator service that only relied on AppleScript. It's free for up to 10 keyboard shortcuts and unlimited is IIRC ~$10 USD. Sep 16, 2018 at 0:58
2

In direct respond to your Title

Hide Everything For Cmd+Space Spotlight Search but Applications

This will work if you type it in Spotlight

Application kind:App

Now it only shows Applications sorted by most recent and frequently used.

enter image description here

If you then expand it with NOT, you can exclude apps you do not want to see

Application kind:app NOT Safari NOT Automator

Of course you could Automate this, but that would be another question on how ?

2
  • 1
    This is a technically correct answer but in practicality this is surely not what I think anyone would want for frequent opening of certain applications.
    – William
    Sep 11, 2018 at 4:37
  • @William you can automate it
    – Ruskes
    Sep 11, 2018 at 4:43
2

This is a great use case for a second tool to just launch applications. I would check out the free to use Launcher by a long term Apple developer - obdev.at

Since spotlight by design is one database only - why not let spotlight index everything and add a second tool that only indexes applications for quick launching. Two of the many benefits of Launchbar are it's way faster than spotlight in my use across dozens of computers and OS versions and that you can define custom shortcuts for specific apps and not have to depend on what spotlight thinks is the correct shortcut.

As a bonus, it also learns as you type to prioritize and learn the short cuts you mean over time. It's uncanny how well it works.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .