![]() I cribbed from the second of Peter's posted macros above to write the import section of the script. On my system the script when run from Script Debugger took about 30 seconds to import 450+ QK type-text shortcuts into Keyboard Maestro. The script above requires the user to give it an alias to the “Shortcuts” folder as seen in the above folder structure. ![]() Regex regExBool case sensitive caseBool process tokens tokensBoolīill's zipped QuicKeys export file looks like this:Īnd if unzipped with the Mac's built-in unzip tool, it actually decodes the export file as well: Set foundDataList to search dataStr for findPattern replace replacePattern ¬ Tell application "Keyboard Maestro Engine" On kmReplace(findPattern, replacePattern, dataStr, regExBool, caseBool, tokensBool) Set exportXML to kmReplace("&", "%26", exportXML, true, false, false) of me Set AppleScript's text item delimiters to "" Set end of errorLog to contents of theAlias Set tempXmlTemplate to kmReplace("%Variable%Trigger%", "", tempXmlTemplate, true, false, false) of me ![]() Set tempXmlTemplate to kmReplace("%Variable%Text%", textExpansion, tempXmlTemplate, true, false, false) of me Set tempXmlTemplate to kmReplace("%Variable%Name%", abbrevName, tempXmlTemplate, true, false, false) of me Set abbrevName to text item 1 of (get name of theAlias's parent's parent) Set AppleScript's text item delimiters to ".qkshortcutd" Set textExpansion to TypeTextArchiveTextToType of ShortcutStepArchivePluginStep of item 1 of ShortcutArchiveSteps of plistRecord Set thePlist to make property list item with properties Set plData to (get text of property list item 1 of property list file (theAlias as text)) as text Set AppleScript's text item delimiters to linefeed Set contents of thePath to alias POSIX file thePath Set plistFileList to paragraphs of plistFileList Set plistFileList to do shell script shCMD Set shCMD to "find " & quoted form of shortcutsFolderPath & " -iname 'ist'" Set shortcutsFolderPath to POSIX path of shortcutsFolderAlias # Tags: shortcutsFolderAlias to alias "Mercury:Users:myUser:Downloads:QuicKeys Shortcuts 2:Shortcuts:" # Task: Import QuicKeys Type Text ShortCuts into Keyboard Maestro 8. # Appl: Finder, Keyboard Maestro, System Events Import QuicKeys Type Text ShortCuts into Keyboard Maestro 8.scpt.zip (13.8 KB). ![]() NOTE – This script will ONLY deal with QuicKeys shortcuts of the specific type Bill has posted, and it does NOTHING to filter those shortcuts from other kinds. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |