| Sign In/My Account | View Cart |
| Article: |
Using Python and AppleScript Together | |
| Subject: | Doesn't work | |
| Date: | 2007-05-10 17:34:07 | |
| From: | bfr | |
| Tried you ose example. Result: command not found. You must be leaving something out. | ||
Showing messages 1 through 1 of 1.
osascript -e 'tell app "Script Editor" to quit'
If that works than you can break each piece of the command into a variable, test it by doing an echo $variable_name(name of your variable) one by one and then concatenate them together when you know the individual variables work.
Another option would be to do this in python and just call a python script, which I in fact do quite a bit:
An idea:
import os
ls = 'ls -l '
dir = '/home'
cmd = ls + dir
def long_list():
os.system(cmd)
long_list()
This type of format is a good way to wrap up shell command into python. Hope that helps!