I am trying to embed an AppleScript in a Python script. I don\'t want to have to save the AppleScript as a file and then load it in my Python script. Is there a way to enter
You can use os.system:
os.system
import os os.system(''' osascript -e '[{YOUR SCRIPT}]' '[{GOES HERE}]' ''')
or, as suggested by Alex Martelli you can use a variable:
import os script = ''' [{YOUR SCRIPT}] [{GOES HERE}] ''' os.system('osascript -e ' + script)