[BNM] Waiting for spawned GUI process to exit on OS X (applescript required instead?)
Jay Caines-Gooby
jaygooby at gmail.com
Fri Feb 1 22:40:32 GMT 2008
I've got several hundred flash movies that I need to generate
thumbnails from. I was hoping to batch up the thumbnailing process
along the lines of:
for file in * do
open "/Applications/Adobe Flash CS3/Players/Flash Player.app"
"./$file/theory_player.swf"; wait; screencapture -tjpeg
"./$file/$file.jpg"
done
aka; for every flash movie, open the player, screengrab it, and do the
next one, but the 'open' command launches the gui app and then exits
immediately as the GUI app starts up, so no joy there.
And trying to capture the PID of the spawned process that 'open'
launches is no good either:
open "/Applications/Adobe Flash CS3/Players/Flash Player.app" &
pid=$! ; wait $pid; wait `ps ax | grep App | grep Flash | cut -d" "
-f1` | echo "Done"
This correctly captures the spawned PID that 'open' leaves behind when
the GUI process (Flash Player.app) runs, but it's not a child process,
so wait can't wait:
wait: pid 11537 is not a child of this shell
I guess I'm going to have to learn some Applescript? Automater's no
good as the Flash Player doesn't appear in the list of Automate-able
applications?
--
http://BarCampBrighton.org 15-16th March
Jay Caines-Gooby
jay at gooby.org
+44 (0)7956 182625
skype: jaygooby
gtalk: jaygooby at gmail.com
AIM: jaygooby
More information about the BNMlist
mailing list. Powered by Wessex Networks