Skip to content

Instantly share code, notes, and snippets.

@carlsmith carlsmith/maestro.py
Last active Aug 12, 2016

Embed
What would you like to do?
IPython line magic for running a Keyboard Maestro macro by name.
import os
from IPython.core.magic import register_line_magic as line_magic
@line_magic
def maestro(name):
quote = lambda text: '"{}"'.format(text)
command = " osascript -e 'tell application {0} to do script {1}' "
os.system(command.format(quote("Keyboard Maestro Engine"), quote(name)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.