I have code like this:
do shell script "mycommand" --this takes forever to complete
more AppleScript code here
I want to run mycommand and immedeately after that run “more AppleScript code here” so i dont need to wait mycommand to complete.
I have code like this:
do shell script "mycommand" --this takes forever to complete
more AppleScript code here
I want to run mycommand and immedeately after that run “more AppleScript code here” so i dont need to wait mycommand to complete.
Put it in the background with an ampersand. Your Applescript code is almost immediately finished while mycommand continues.
I tried this and it don’t work:
do shell script "mycommand &" --this takes forever to complete
more AppleScript code here
You should look at the Background Process section of Apple’s Technical Note on the “do shell script” command: TN2065, found at http://developer.apple.com/library/mac/technotes/tn2002/tn2065.html
Summary: The ampersand is often not enough - you need redirect the output for most processes, either to a file you can read to check progress, or to /dev/null if you want to ignore all output and errors.