docs » LookupSelection

Show a popup window with the currently selected word in lexicon, notes, online help

The spoon uses hs.urlevent.openURL("dict://" .. text)

Download: https://github.com/Hammerspoon/Spoons/raw/master/Spoons/LookupSelection.spoon.zip

API Overview

API Documentation

Variables

logger
Signature LookupSelection.logger
Type Variable
Description Logger object used within the Spoon. Can be accessed to set the default log level for the messages coming from the Spoon.
Source Source/LookupSelection.spoon/init.lua line 42

Methods

bindHotkeys
Signature LookupSelection:bindHotkeys(mapping)
Type Method
Description Binds hotkeys for LookupSelection
Parameters
  • mapping - A table containing hotkey modifier/key details for the following items:
    • lexicon - open in lexicon app
    • neue_notiz - create new note in notes app
    • hsdocs - display online help
Returns
Notes
  • Sample value for mapping:
 {
    lexicon = { { "ctrl", "alt", "cmd" }, "L" },
    neue_notiz = { { "ctrl", "alt", "cmd" }, "N" },
    hsdocs = { { "ctrl", "alt", "cmd" }, "H" },
 }
Source Source/LookupSelection.spoon/init.lua line 93
openLexicon
Signature LookupSelection:openLexicon()
Type Method
Description Get the current selected text in the frontmost window and display a translation popup with the translation between the specified languages
Parameters
  • None
Returns
  • The LookupSelection object
Source Source/LookupSelection.spoon/init.lua line 58