admin管理员组

文章数量:1122832

Currently I have a zsh custom (or alias) command - "openChrome" that open a new chrome window.

My question is, can we just straightaway type in "openChrome" in Spotlight (macOs) so that when I hit enter after entering the command, the zsh terminal command is trigger?

Currently when I type in "openChrome" into Spotlight and hit enter, a google search is made.

(No I am not looking to make a quick action file/script on my desktop).

If this feature is possible, please help / guide me. Would be a cool feature to have!

Currently I have a zsh custom (or alias) command - "openChrome" that open a new chrome window.

My question is, can we just straightaway type in "openChrome" in Spotlight (macOs) so that when I hit enter after entering the command, the zsh terminal command is trigger?

Currently when I type in "openChrome" into Spotlight and hit enter, a google search is made.

(No I am not looking to make a quick action file/script on my desktop).

If this feature is possible, please help / guide me. Would be a cool feature to have!

Share Improve this question asked Nov 22, 2024 at 9:07 Awshaf IshtiaqueAwshaf Ishtiaque 92110 silver badges13 bronze badges 1
  • One possibility: if you install Xcode, Spotlight will list any executable scripts on your system that match the search. This answer describes some of how it works, although it is aimed at solving the reverse issue of how to hide 'Developer' results. – Gairfowl Commented Nov 22, 2024 at 10:27
Add a comment  | 

1 Answer 1

Reset to default 0

In Finder:

  • Go to Applications/Utilities
  • Right-click the Terminal app and choose "Make Alias"
  • Rename it to "openChrome".

In System Settings:

  • Go to Spotlight and uncheck the options for "Siri Suggestions" and "Websites"

This should put your new command at the top of Spotlight's results when you type it.

Further reading: symbolic links.

本文标签: How to execute a zsh terminal command from macos Spotlight directlyStack Overflow