I don't know how to do it in applescript, but you can do this by using the /usr/bin/open
UNIX-level OS X command. This snippet will open TextEdit.app and block, waiting for it to quit before continuing:
import subprocess
subprocess.call(
["/usr/bin/open", "-W", "-n", "-a", "/Applications/TextEdit.app"]
)
Look at the open man page (man open
) and the python subprocess module documentation for more details.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…