Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.5: How to launch-and-hide via AppleScript in 10.5' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: How to launch-and-hide via AppleScript in 10.5
Authored by: francola on Jan 29, '09 09:30:07AM

OK, good. That was exactly what I found therefore the reason for creating 2 activates in a row. Is there another way to properly send a delay command?

Thanks!



[ Reply to This | # ]
10.5: How to launch-and-hide via AppleScript in 10.5
Authored by: GrandMauvaisDan on Jan 29, '09 09:45:34AM
delay some_number
delays for some_number of seconds. So for me the following appears to work fine:
tell application "Mail" to activate
delay 0.5
tell application "Finder" to set visible of process "Mail" to false


[ Reply to This | # ]
10.5: How to launch-and-hide via AppleScript in 10.5
Authored by: ptone on Jan 29, '09 10:45:02AM

delay 5

this will tell the applescript to pause for 5 seconds

decimals are OK, so you could try 3.5

this will be machine specific based on how fast mail launches on your machine



[ Reply to This | # ]
10.5: How to launch-and-hide via AppleScript in 10.5
Authored by: trosberg on Jan 31, '09 04:43:55AM
To make sure a launching app is ready to accept input (like visible property), I scripted the app to return a user interface element. I believe this is the minimum delay the app needs.
tell application "iTunes"
	try -- We don't need error messages
		get window 1 -- "tell application" goes on until the app has a user interface, or returns an error.
	end try
end tell

tell application "System Events" -- It is better than the Finder.
	set visible of process "iTunes" to false
end tell


[ Reply to This | # ]