3

In a text box, I can right click and select Transformations > Make Uppercase.

Is it possible to create my own text transformations? a super simplified example would be to wrap the selected text in parenthesis.

1
  • did you try anything like Automator service, a Apple Script ?
    – Ruskes
    Commented Nov 6, 2014 at 18:13

2 Answers 2

3

Make an Automator service which accepts text and use the following AppleScript action:

      

on run {input}
    return "(" & (input as string) & ")"
end run
2

You can also create ~/Library/Keybindings/ and save a property list like this as ~/Library/Keybindings/DefaultKeyBinding.dict:

{
  // option-9 to wrap with parentheses
  "~9" = (setMark:, moveBackward:, insertText:, "(", swapWithMark:, moveForward:, moveForward:, insertText:, ")", moveBackward:);
}

Quit and reopen applications to apply the changes.

See http://osxnotes.net/keybindings.html or https://github.com/ttscoff/KeyBindings/blob/master/DefaultKeyBinding.dict for more examples.

You must log in to answer this question.

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