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


Click here to return to the 'Launch login items via AppleScript to avoid login delays' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Launch login items via AppleScript to avoid login delays
Authored by: Agaethon on Nov 18, '09 10:01:16PM
Great scripts! I'm using the latest one from tedw and its working just great, except when i have it launch Quicksilver it will not hide it. Though it will work for Things. Whenever it launches I see the "flying" QS. When I had it set as a normal launch item before, as long as I set the checkmark to 'hide" it hid it. But now, even if I set the visibility to false it still shows it. I figure it has something to do with Quicksilver not fully loaded yet to except the visibility script. I tried increasing the delay and the order of the apps but no go. Any suggestions? Thanks!

set theAppList to {{name:"Things", vis:false}, {name:"Mail", vis:true}, {name:"Quicksilver", vis:false}}
set theDelay to 1

repeat with currentApp in theAppList
	tell application (name of currentApp) to launch
	delay theDelay
	tell application "System Events"
		try
			if background only of process (name of currentApp) is false then
				set visible of process (name of currentApp) to (vis of currentApp)
			end if
		end try
	end tell
end repeat
Edited on Nov 18, '09 10:02:45PM by Agaethon


[ Reply to This | # ]
Launch login items via AppleScript to avoid login delays
Authored by: tedw on Nov 19, '09 12:29:36AM
Unfortunately, not every app is equally respectful of visibility requests. This might work a little better (replace the System Events tell block with this):
tell application "Finder"
	try
		open application (name of currentApp) with properties {visible:(vis of currentApp)}
	on error
		tell application "System Events"
			try
				if background only of process (name of currentApp) is false then
					set visible of process (name of currentApp) to (vis of currentApp)
				end if
			end try
		end tell
	end try
end tell


[ Reply to This | # ]