Skip to content

Instantly share code, notes, and snippets.

@jostyee
Created November 7, 2021 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jostyee/39f41f83248ce81b3024b9d4bb037ea9 to your computer and use it in GitHub Desktop.
Save jostyee/39f41f83248ce81b3024b9d4bb037ea9 to your computer and use it in GitHub Desktop.
Keyboard Maestro macro: translate selected text with DeepL
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>CreationDate</key>
<real>657891648.46214402</real>
<key>Macros</key>
<array>
<dict>
<key>Actions</key>
<array>
<dict>
<key>Action</key>
<string>Copy</string>
<key>ActionUID</key>
<integer>2182</integer>
<key>IsDisclosed</key>
<false/>
<key>MacroActionType</key>
<string>CutCopyPaste</string>
<key>TimeOutAbortsMacro</key>
<true/>
</dict>
<dict>
<key>Action</key>
<string>PercentEncodeForURL</string>
<key>ActionUID</key>
<integer>2177</integer>
<key>Destination</key>
<string>Variable</string>
<key>DestinationVariable</key>
<string>Parameter</string>
<key>MacroActionType</key>
<string>Filter</string>
<key>Source</key>
<string>Clipboard</string>
</dict>
<dict>
<key>ActionUID</key>
<integer>2178</integer>
<key>Conditions</key>
<dict>
<key>ConditionList</key>
<array>
<dict>
<key>ClipboardConditionType</key>
<string>Matches</string>
<key>ClipboardText</key>
<string>^[a-zA-Z-=_"!&amp;.(),'\s]+$</string>
<key>ConditionType</key>
<string>Clipboard</string>
</dict>
</array>
<key>ConditionListMatch</key>
<string>All</string>
</dict>
<key>ElseActions</key>
<array>
<dict>
<key>ActionUID</key>
<integer>2180</integer>
<key>MacroActionType</key>
<string>SetVariableToText</string>
<key>Text</key>
<string>zh/en/</string>
<key>Variable</key>
<string>Parameter</string>
<key>Where</key>
<string>Prepend</string>
</dict>
</array>
<key>MacroActionType</key>
<string>IfThenElse</string>
<key>ThenActions</key>
<array>
<dict>
<key>ActionUID</key>
<integer>2179</integer>
<key>MacroActionType</key>
<string>SetVariableToText</string>
<key>Text</key>
<string>en/zh/</string>
<key>Variable</key>
<string>Parameter</string>
<key>Where</key>
<string>Prepend</string>
</dict>
</array>
<key>TimeOutAbortsMacro</key>
<true/>
</dict>
<dict>
<key>ActionUID</key>
<integer>2554</integer>
<key>MacroActionType</key>
<string>DeletePastClipboard</string>
<key>PastExpression</key>
<string>0</string>
</dict>
<dict>
<key>ActionUID</key>
<integer>2181</integer>
<key>IsDefaultApplication</key>
<true/>
<key>MacroActionType</key>
<string>OpenURL</string>
<key>TimeOutAbortsMacro</key>
<true/>
<key>URL</key>
<string>https://www.deepl.com/translator#%Variable%Parameter%</string>
</dict>
</array>
<key>CreationDate</key>
<real>657954984.93093097</real>
<key>ModificationDate</key>
<real>657955165.06336105</real>
<key>Name</key>
<string>Translate with DeepL with hotkey</string>
<key>Triggers</key>
<array>
<dict>
<key>FireType</key>
<string>Pressed</string>
<key>KeyCode</key>
<integer>17</integer>
<key>MacroTriggerType</key>
<string>HotKey</string>
<key>Modifiers</key>
<integer>2304</integer>
</dict>
</array>
<key>UID</key>
<string>51E4A648-C0E7-43B2-B581-5240F5E6F855</string>
</dict>
</array>
<key>Name</key>
<string>Global Macro Group</string>
<key>ToggleMacroUID</key>
<string>527E6B29-59C5-4B83-9C47-B4BFD7D62724</string>
<key>UID</key>
<string>804D32AF-0B39-439F-8EF3-493A833B14CA</string>
</dict>
</array>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment