Time-sensitive applescipt question using Do Shell Script

Hey All,

I’m new to applescripting, and working on a script that runs an application, then goes in and clicks through the prompts using System Events. I have both parts working but the problem is bridging the two. Unfortunately I can’t post my exact script but it looks similar to the following:

tell application “Terminal”
activate
(do shell script “cd folder1; cd folder2; cd folder3; cd folder4; cd folder5; ./applicationName”)
end tell
delay 7
tell application “System Events”

The proplem I’m having is that it hangs after running the do shell script. It runs the application, then sits there. If I close the application it continues with the code, but that doesn’t help. Any Ideas?

EDIT: sorry if the subject is misleading, by time sensitive, I mean it’s important I find a solution soon

Hi,

you don’t need the terminal to run an application

activate application "applicationName"

will do the same. There is also no need for a delay. AppleScript waits until the application is running

Ah, I found the answer on another forum, I have to add > file_path 2>&1 &" to the end of it to force a false return

ah, the reason I’m running it that way, as I forgot to mention, is that I’m running from a mounted image or disk.

you can use the activation command also with a full string path

activate application "path:to:myApplication.app"

awesome that works waaaaay better. Thanks alot.