Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

alfredo_pacino

macrumors newbie
Original poster
Apr 12, 2019
8
0
Like the windows button in Windows OS, it would be very useful to me a single button shortcut for spotlight. There is a way to do that?
 
Paste the below code in Script Editor.app , you can find them in Applications / Utilities /
Script Editor.app then save as Application Name ➣ ButtonSpotlight
See image
captu619.png


set
the searchText to the text returned of (display dialog "Enter the name of an item you wish to search for in Spotlight:" default answer "" with icon note)

tell application "System Events"

keystroke space using {command down}

keystroke the searchText

--[1]

end tell

 
Last edited:
I just asked for a shortcut, but this is an interesting solution, thanks :)
I edit the script to add with icon note

EDIT ****
I just test the app and In Mojave strangely its work only if you start the script from the Script Editor.app

Error in System Events: ButtonSpotlight is not allowed to send keystrokes. (1002):(
 
Last edited:
somehow, hitting command & the space bar at the same time doesn't seem very complicated. but you could look into karabiner, or bettertouchtool, perhaps.
 
somehow, hitting command & the space bar at the same time doesn't seem very complicated. but you could look into karabiner, or bettertouchtool, perhaps.

it is matter of habits..I find very handy the windows button on Windows OS.
Anyway it looks not doable..shortcuts on MacOS are fired "on press", on Windows they are fired "on release".
So I cannot use a 1 keystroke shortcut on the Win (cmd) key..I would end up opening the Launchpad on every other shortcut on cmd key: undo/redo, copy/cut/paste..
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.