Automating (and Scheduling) System Keyboard Text Replacements

@coordinated I made some minor changes to your already amazing macro to turn it into a subroutine. Thank you so much for all of your hard work figuring this out.

Update keyboard text expansion subroutine.kmmacros (28.5 KB)

Changes

  • Updated the “Check that both parameters were supplied” step to verify that the Local__replacementString is empty. I think this might be a bug fix.
  • Changed the shortcutString, replacementString, and matchesFound to be local variables (renamed them to be prefixed with Local__. This required minor changes to be made to the AppleScript (search for “kmInst” to see them).
  • Added delay 0.5 before getting the “Keyboard” window to avoid getting an AppleScript error if the Preferences Pane is already open.
  • Added logging to compliment the notifications
  • Changed to be a subroutine with parameters (Local__shortcutString and Local__replacementString) and removed the TriggerValue parsing
  • Updated documentation
1 Like