Skip to content

Instantly share code, notes, and snippets.

@mekkablue
Last active August 29, 2015 14:06
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 mekkablue/e38115c89f1e84dadba6 to your computer and use it in GitHub Desktop.
Save mekkablue/e38115c89f1e84dadba6 to your computer and use it in GitHub Desktop.
from subprocess import Popen, PIPE
def runAppleScript(scpt, args=[]):
p = Popen(['osascript', '-'] + args, stdin=PIPE, stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate(scpt)
return stdout
nameOfFont = """
tell application "InDesign"
tell front document
tell character 1 of parent story of first text frame
applied font
end tell
end tell
end tell
"""
print "---%s---" % runAppleScript(nameOfFont).strip().replace("\t",">>>")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment