@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
, andmatchesFound
to be local variables (renamed them to be prefixed withLocal__
. 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
andLocal__replacementString
) and removed theTriggerValue
parsing - Updated documentation