7
4
I have an applescript to initiate my work environment, but have a small quibble with it. I want the script to launch several programs, and then hide them, once they started. The code looks like this currently:
tell application "Firefox" to activate
delay 0.5
tell application "Finder"
set visible of process "Firefox" to false
end tell
Obviously, delay 0.5 is just a placeholder, ideally I would want to hide the program as soon as it finished loading. Unfortunately, my load times vary a lot (from 0.2 - 5s) Is there something like a callback or a function to monitor the events of applications?
Why not just call
open -aw Firefox
and then hide the app using AppleScript? – slhck – 2012-09-03T19:11:46.207@slhck Sorry, I don't understand. Parameter
-a
requires a specific app to open with, and-W
waits until the app that was open is closed. My understanding fromman open
is that it has no options that might be useful for this? – Christian Macht – 2012-09-03T19:39:39.087Whoops, sorry, I misunderstood that. – slhck – 2012-09-03T19:45:57.570