-
Notifications
You must be signed in to change notification settings - Fork 0
/
unicode2typPt2.applescript
39 lines (32 loc) · 1.21 KB
/
unicode2typPt2.applescript
1
-- Created by: Peter David Shannon-- Created on: 2016-04-11---- Copyright (c) 2016 Peter Shannon-- Feel free to modify the script for your own use, but leave the copyright notice intact.-- I use Keyboard Maestro to trigger this script if the clipboard changes.-- Perhaps there are some other automation programs which can do the same-- thing.on new_expansion(pAbbreviation, pChar, mDescription) tell application "Keyboard Maestro Engine" to set mRuleSetName to value of variable "unicodeRuleSet" tell application "Typinator" if exists rule set mRuleSetName then set mRuleSet to rule set mRuleSetName tell mRuleSet set mNewRule to make new rule end tell set abbreviation of mNewRule to pAbbreviation set whole word of mNewRule to false set plain expansion of mNewRule to pChar if mDescription ≠ "" then set description of mNewRule to pChar & " " & mDescription end if activate end if end tellend new_expansiontell application "Keyboard Maestro Engine" set mAbbreviation to get value of variable "Abbreviation" set mChar to get value of variable "inputChar" set mDescription to get value of variable "Description"end tellnew_expansion(mAbbreviation, mChar, mDescription)