Utiliza un Servicio de Automator para añadir caracteres especiales

Este es un buen ejemplo de cómo usar Automator para disponer de un menú emergente que te permite elegir entre una lista de caracteres especiales (en el ejemplo, los específicos para especificar atajos de teclado) a través del uso de un Applescript.

Usando este servicio, es posible, mientras escribes texto en una aplicación en primer plano, poder añadir estos caracteres especiales de forma que no necesitas buscarlos, con cierta frecuencia, en la paleta de caracteres o tratar de recordar en que atajo de teclado se encuentran.

Paso a paso

  • Abre Automator, en Aplicaciones
  • Selecciona un Servicio entre las plantillas que permite usar Automator
  • Cambia la entrada a «ninguna» y «todas las aplicaciones»
  • Añade a la acción un nuevo contenedor para ejecutar un Applescript
  • Añade el Applescript a continuación en el cuadro de la acción de Automator
  • tell application «System Events»

    set frontApp to name of first process whose frontmost is true

    end tell

    set theCommand to «data utxt2318» as Unicode text

    set theControl to «data utxt2303» as Unicode text

    set theOption to «data utxt2325» as Unicode text

    set theShift to «data utxt21E7» as Unicode text

    set theEscape to «data utxt238B» as Unicode text

    set theTab to «data utxt21E5» as Unicode text

    set theReturn to «data utxt21A9» as Unicode text

    set theEnter to «data utxt2324» as Unicode text

    set doubleTab to tab & tab

    tell application frontApp

    choose from list {theShift & doubleTab & «Shift», theControl & doubleTab & «Control», theOption & doubleTab & «Option», theCommand & doubleTab & «Command», theOption & theCommand & doubleTab & «Option+Command», theEscape & doubleTab & «Escape», theTab & doubleTab & «Tab», theReturn & doubleTab & «Return», theEnter & doubleTab & «Enter»} with prompt «Pick the symbols you want:» OK button name «Insert» with multiple selections allowed

    end tell

    if result is not equal to false then

    set pickedSymbols to result as string

    set displaySymbols to «»

    if pickedSymbols contains «Shift» then

    set displaySymbols to displaySymbols & theShift

    end if

    if pickedSymbols contains «Control» then

    set displaySymbols to displaySymbols & theControl

    end if

    if pickedSymbols contains «Option» then

    set displaySymbols to displaySymbols & theOption

    end if

    if pickedSymbols contains «Command» then

    set displaySymbols to displaySymbols & theCommand

    end if

    if pickedSymbols contains «Escape» then

    set displaySymbols to displaySymbols & theEscape

    end if

    if pickedSymbols contains «Tab» then

    set displaySymbols to displaySymbols & theTab

    end if

    if pickedSymbols contains «Return» then

    set displaySymbols to displaySymbols & theReturn

    end if

    if pickedSymbols contains «Enter» then

    set displaySymbols to displaySymbols & theEnter

    end if

    tell application «System Events»

    tell process frontApp

    set the clipboard to displaySymbols

    keystroke «v» using {command down}

    end tell

    end tell

    end if

  • Guarda el Servicio como algo que puedas recordar
  • Ahora, activa un atajo de teclado para activar este servicio en el menú: si no tienes muy claro como hacerlo, puedes usar este tutorial en faq-mac
  • Abre una aplicación para el tratamiento de textos
  • Invoca el el Servicio usando el atajo de teclado
  • Ya solo queda seleccionar el el carácter que quieras introducir … y listo