Created
August 30, 2013 00:19
-
-
Save jacktasia/6384960 to your computer and use it in GitHub Desktop.
auto-save illustrator every 60 seconds (mac only)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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