Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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