If f.startswith(TEXTEXPANDER_PATH + "/group_")] Xml_files = [f for f in glob.glob(TEXTEXPANDER_PATH + "/*.xml") # Let's get all the xml group files in the directory Return a list of dictionaries where the keys are the name of the group Return OPTIONAL_NEW_PREFIX + _paste_or_type(snippet_type=None):Įach TextExpander group is its own file starting with the file name 'group_'. 'Name': 'Snippet - %s' % _abbreviation(name): Return getattr(cls, macro_name)(group_name, name, text, javascript(group_name, name, text, abbreviation): Snippet_types_to_values = dict((value, key) for key, value in snippet_eritems())Ĭlass macro_by_name(cls, macro_name, group_name, name, text, abbreviation): # Remember it MUST be 'paste' or 'type' or the script will fail # Change this if you want the snippet to inserted by typing or pasting # If your snippet is ttest, you can make it ttest by changing the variable to ' ' # Change this if you'd like to change your snippets when importing to Keyboard Maestro SAVE_PATH = HOME + '/Desktop/TextExpander_to_KeyboardMaestro' TEXTEXPANDER_PATH = HOME + '/Dropbox/TextExpander/Settings.textexpandersettings' # Change this path to where ever your TextExander Settings live # Modify this area to customize how the script will run Keyboard Maestro groups with the same title and abbreviation.Īll new KM Macro files will be saved to the Desktop. This script will parse through all group_*.xml files within your TextExpander folder.Īnything marked as Plain Text, Shell Script or JavaScript should be converted into You can download the script on Github here import plistlib Added some instruction on how to edit the variables to have the script do what you want.Optional prefix if you want to change that up when moving to Keyboard Maestro.I also added a list of requirements above for running the script.Īlso thanks to Dr Drang for posting about the script! I've made some updates and also put up a repo for those who would like to make edits and pull requests. I had forgotten that wasn't a standard library in Python 2.7. You'll now have a folder on your Desktop named 'TextExpander_to_KeyboardMaestro' with all of your groups.īig thanks to NW in the comments for helping me debug a few things. To run, it's as simple as navigating to the location where the script lives in Terminal.app and entering python TE.py If anyone figured this out, please let me know.īefore running, be sure to update the variable TEXTEXPANDER_PATH to wherever your TextExpander settings file lives. I've tried changing Keyboard Maestro to only fire on delimiters, but it doesn't seem to work. I haven't really figured out if there's a way to do this. ![]() This means if you had a "today's date" snippet, you'll need to rewrite that one 1. Placeholders and variables from TextExpander won't work.I didn't test Applescript since I didn't have any.Some I might in the future, others maybe not: ![]() There are a few things that I haven't yet solved. If you used groups in TextExpander, they show up as "Snippets - " in Keyboard Maestro.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |