Been messing around with this today.
At the moment, if I run Trillian in the login items, it’s too quick for my Wifi and tells me the connection fails.
Simple fix for that is obviously just a simple delay script. So I did that with no problems.
That got me thinking- since I’m already writing a script, why not get Trillian to do what I want it to when I launch it- hide the contact list window as soon as it’s signed in. Sort of like a silent login.
I’ve been using UI Browser a bit trying to work out what the best approach is. The closest I’ve come with limited success is this:
delay 3 activate application "Trillian" tell application "System Events" tell process "Trillian" get title of window 1 if title of window 1 is "Trillian" then click button 1 of window 1 else delay 0.5 repeat until title of window 1 is "Trillian" end repeat click button 1 of window 1 end if end tell end tell
The signing in window doesn’t have a title. If I run just the get title of window 1 for the signing in window, it comes back in the results as “”.
So this idea above basically waits until the title of window 1 is Trillian, then clicks close on that window (contact list).
It seems to work if I’ve got another application window open. For example, I just tried running the script with this Firefox window open that I’m typing this into, and it worked just fine.
However, if I minimize FF, I get the error: “No result was returned from some part of this expression.” number -2763
Or if I save it as an app, I get "Can’t get window 1 of «class prcs» “Trillian” of application “System Events”. Invalid index.
I’ve also had that error when running it from Applescript Editor once or twice.
I don’t know if I’m going about this the right way or not. So if anyone’s got any suggestions of how to fix what I’ve done, or a better way of doing what I’m trying to do, please post!