2

Sometimes when editing text, I want to use the Emoji & Symbols viewer to quickly type a symbol. Other times, I want to open the full Character Viewer window. Unfortunately, there only seems to be one keyboard shortcut to open them (Edit > Emoji & Symbols, space), and it simply remembers which you used last. Changing which interface is displayed seems to require the use of a mouse to click the toggle button in the top-right of the window.

How can I easily select which of them to bring up? Ideally, I would like to end up with two keyboard shortcuts, one for each interface. Third-party solutions are acceptable, but a native solution would be ideal.

Possibly useful starting point: "Show Emoji & Symbols" in the Input menu (enabled via System Preferences > Keyboard > Keyboard > Show keyboard and emoji viewers in menu bar) seems to always bring up the full Character Viewer, regardless of the last state. Activating this with a keyboard shortcut would be perfect, though I would much prefer doing so programmatically rather than via the menu GUI.

4
  • in what app do you want to use that ?
    – Ruskes
    Oct 16, 2018 at 19:49
  • Many places, but primarily Chrome, MailMate, and Messages.
    – Tuesday
    Oct 16, 2018 at 19:50
  • so you want system wide Service
    – Ruskes
    Oct 16, 2018 at 19:57
  • Yes, sorry if that wasn't clear from my question.
    – Tuesday
    Oct 16, 2018 at 19:58

1 Answer 1

2

If I were in a similar situation, I would do the following:

  • Change the default keyboard shortcut for Emoji & Symbols from ⌃⌘Space to ⌃⌥⌘Space so that the default ⌃⌘Space can be used as a shortcut with one of the scripts, the primary one.

  • Create two AppleScript scripts, one for showing Emoji & Symbols, (the primary one for me), and the other for showing Character Viewer. (This could be done in one script however, for coding simplicity two will be used.)

  • Use FastScripts to assign a keyboard shortcut to each. The first for My Emoji & Symbols to ⌃⌘Space and for My Character Viewer, use ⌃⇧⌘Space as shown in the image further below.

    Note that I have no affiliation with Red Sweater Software, the developer of FastScripts, and am just a satisfied user.

    • Note that in place of using FastScripts, an Automator Service can be used. However, I prefer the former because it has worked better for me then the latter.

The following was tested and worked under macOS High Sierra...

First, change the global keyboard shortcut for the Emoji & Symbols menu item:

  • System Preferences > Keyboard > Shortcuts > App Shortcuts

    • Click the [+] to add a new shortcut with the following settings:

    • Applications: All Applications

    • Menu Title: Emoji & Symbols
    • Keyboard Shortcut: ⌃⌥⌘Space
              See image further below.

Next, create two AppleScript scripts (.scpt) files in ~/Library/Scripts/, one named My Emoji & Symbols and the other named My Character Viewer, adding the following to each:

For My Emoji & Symbols:

do shell script "defaults write com.apple.CharacterPaletteIM CVStartAsLargeWindow -bool false"
delay 0.5
tell application "System Events" to keystroke space using {control down, option down, command down}

For My Character Viewer:

do shell script "defaults write com.apple.CharacterPaletteIM CVStartAsLargeWindow -bool true"
delay 0.5
tell application "System Events" to keystroke space using {control down, option down, command down}
  • Note the only difference between the two is the value of -bool, being true or false for the CVStartAsLargeWindow key. Also, the value of the delay command is to allow time for the defaults command to make the write before System Events triggers the new global keyboard shortcut for the Emoji & Symbols menu item. The value of the delay command may need be adjusted, so do so as needed.

Then in FastScripts > Preferences... > Script Shortcuts, assign ⌃⌘Space (or ⌃⌘␣) to My Emoji & Symbols, and assign ⌃⇧⌘Space (or ⌃⇧⌘␣) to My Character Viewer.   See image below.

  • Note that FastScripts will need to be added to: System Preferences > Security & Privacy > Privacy > Accessibility   See image below.

If using Automator Services, use a Run Apple Script action with the example AppleScript code, show above, replacing the default code in each and assign keyboard shortcuts via: System Preferences > Keyboard > Shortcuts > Services

  • Note that the mentioned naming conventions and or paths, et cetera, have changed for some items in macOS Mojave and will need to be adjusted accordingly. I am not yet running macOS Mojave however, have seen posts on some of the differences. You'll need to adjust as necessary if running macOS Mojave.

Key Symbol Legend:

  • Shift:
  • Control:
  • Option:
  • Command:
  • Space: Space

System Preferences > Keyboard > Shortcuts > App Shortcuts

App Shortcuts


FastScripts > Preferences... > Script Shortcuts
     • Note that the character, shown in the shortcut below, is for the space character.

Script Shortcuts


System Preferences > Security & Privacy > Privacy > Accessibility

Accessibility

3
  • Ah, there we go, CVStartAsLargeWindow was what I was looking for! Where did you find that?
    – Tuesday
    Oct 23, 2018 at 15:51
  • @Timothy Mueller-Harder, I knew about the CVStartAsLargeWindow key in com.apple.CharacterPaletteIM from some other scripts I used to manipulate it in the past. IIRC Back in e.g. OS X Mountain Lion, where I wrote some of these scripts, one could also programmatically open Character Viewer with the open -a ... command however, that has changed. What I typically do is monitor e.g. ~/Library/Preferences, make a change, see what .plist file changed, read the .plist file, revert the change, read the .plist file again and then compare the output of both reads to see the differences, etc. Oct 23, 2018 at 16:01
  • @Buscar웃, I'm assuming it was you that down-voted my answer because someone down-voted your answer which you then deleted. If it was you, what's the justification as it answered the question asked by the OP and he was the one that both up-voted it and accepted the answer because it was what he was looking for. Unlike yours, which was about Keyboard Viewer which had nothing to do with what was asked and I can see why it got down-voted! Oct 24, 2018 at 1:52

You must log in to answer this question.

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