single button shortcut

Discussion in 'macOS Mojave (10.14)' started by alfredo_pacino, Apr 12, 2019.

  1. alfredo_pacino macrumors newbie

    alfredo_pacino

    Joined:
    Apr 12, 2019
    #1
    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?
     
  2. chris1111, Apr 20, 2019
    Last edited: Apr 20, 2019

    chris1111 macrumors newbie

    chris1111

    Joined:
    Jul 8, 2015
    Location:
    Montréal Canada
    #2
    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
    [​IMG]

    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

     
  3. alfredo_pacino thread starter macrumors newbie

    alfredo_pacino

    Joined:
    Apr 12, 2019
    #3
    I just asked for a shortcut, but this is an interesting solution, thanks :)
     
  4. chris1111, Apr 20, 2019
    Last edited: Apr 20, 2019

    chris1111 macrumors newbie

    chris1111

    Joined:
    Jul 8, 2015
    Location:
    Montréal Canada
    #4
    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):(
     
  5. fisherking macrumors 604

    fisherking

    Joined:
    Jul 16, 2010
    Location:
    ny somewhere
    #5
    somehow, hitting command & the space bar at the same time doesn't seem very complicated. but you could look into karabiner, or bettertouchtool, perhaps.
     
  6. alfredo_pacino thread starter macrumors newbie

    alfredo_pacino

    Joined:
    Apr 12, 2019
    #6
    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..
     

Share This Page

5 April 12, 2019