Re: Batch Program Processing via AppleScript
Re: Batch Program Processing via AppleScript
- Subject: Re: Batch Program Processing via AppleScript
- From: JJ <email@hidden>
- Date: Mon, 03 Dec 2001 23:34:58 +0100
>
I am a newbie to AppleScript, so this problem may be already solved.
>
However, I wasn't able to find anything in the archives.
>
>
I have a large number of Absoft Macintosh FORTRAN programs (call them A,
>
B, C, D, etc) that must be executed sequentially. The problem is: B must
>
only start executing after A is completely done, C must only start
>
executing after B is completely done, etc. How can this batch program
>
processing be done using AppleScript? (This is analogous to a simple
>
DOS BAT file.). When I tried, Programs A, B, C, D, etc, all began
>
running at the same time, instead of waiting appropriately.
>
>
Thanks in Advance.
The simplest way, let the Finder check if the app is running.
-- NOT TESTED
set PROGRAM_A to alias "HD:Applications:A"
set PROGRAM_B to alias "HD:Applications:B"
set PROGRAM_C to alias "HD:Applications:C"
tell app "Finder"
open PROGRAM_A
delay 3 -- wait while launching
repeat
set CurrentApps to name of processes
if "A" is not in contents of CurrentApps then exit repeat
end repeat
open PROGRAM_B
delay 3 -- wait while launching
repeat
set CurrentApps to name of processes
if "B" is not in contents of CurrentApps then exit repeat
end repeat
open PROGRAM_C
end tell
JJ