Skip to content

Instantly share code, notes, and snippets.

@jacktasia
Created August 30, 2013 00:19
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 jacktasia/6384960 to your computer and use it in GitHub Desktop.
Save jacktasia/6384960 to your computer and use it in GitHub Desktop.
auto-save illustrator every 60 seconds (mac only)
import os
import time
import subprocess
def is_illustrator_open():
""" probably a better way to do this! """
ps = subprocess.Popen(['ps', 'ax'], stdout = subprocess.PIPE)
grep = subprocess.Popen(['grep', 'Adobe Ill'], stdin = ps.stdout, stdout = subprocess.PIPE)
wc = subprocess.Popen(['wc', '-l'], stdin = grep.stdout, stdout = subprocess.PIPE)
open = int(wc.communicate()[0])
return open > 1
while True:
if is_illustrator_open():
os.system("""osascript -e 'tell application "Adobe Illustrator" to save current document'""")
time.sleep(60)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment