Link to home
Start Free TrialLog in
Avatar of mwarbeck
mwarbeck

asked on

Scripting 3rd Party Application

First off, I'm not too experienced in scripting. Here's what I need to do:

I'm running a program called HotLine Server (http://www.hotspringsinc.com). It's a free program that creates a community for exchange of files and chat. It has a window with control buttons that include one to reload, which causes it to reread an agreement file that remote users see when they log on. I need to click that button daily.

I tried to use Applescript GUI scripting. To identify the button I tried using UIElementInspector and Prefab UI Browser. The problem is that the buttons don't show up as elements in the window using these tools. The Maximize, Minimize, and Close buttons show as elements, as does the header text, but not the command buttons.

I tried using killall -HUP HLserver19 from a command line but the application doesn't like it. When it comes back the UI isn't running and it refuses connections. Is there any hope?

BTW, this is on a G4 running OS 10.3.1.

Thanks,
Mark
Avatar of Insolence
Insolence

Use QuickKeys!

http://www.cesoft.com/products/qkx.html

Record a script that when that window comes up, it clicks the "ok" button (or whatever).  And then modify the script a little bit to make it infinitely loop, constantly waiting for that program to bring up the window again, just so it can click it.  =)  Isn't technology neat.

I used to use this program on OS-9 for doing this exact thing.  I used it to auto-close AOL disconnect windows, and to click hotline client register notices back with hotline client 1.0.  =P  Hehe... this is their OS-X version, and I just confirmed it works fine with 10.3 with their patch on their website.  =)  Enjoy

 - Insolence
Avatar of mwarbeck

ASKER

Quickkeys may be an option. I've been playing with it for a few days but can't get the shortcut to run triggered by time and day. I can click the Run button and it executes but no matter what I do with the time it won't run. I close the shortcut editor window, saving the shortcup. I tried leaving the Quickkeys window open and I tried minimizing it. No matter what it doesn't run when the time condition is met. I even set it to run every 5 minutes but it just doesn't run on schedule. The shortcut has three steps: switch to the Hotline Server, click in the title bar of the window, then click on the button. Any ideas as to why it won't run by the schedule?
Well, if you're running a hotline server, it should (usually) be on a server that you don't play with often.  It sounds like it's your desktop computer or something.  =P  In this case, good luck man.  If it is a server that no one usually has physical access, Quickkeys will do the job for you, I can guarantee it.  It's really as easy as hitting record, then clicking that OK button (or whatever) then hitting stop.  Then editing the script manually to run infinitely.  That doesn't always work... but if it doesn't, you can always write the script manually.  The quickkeys language is so simple...  =P  Do a "wait for window with title" and put in the title of that window, then do a "wait 2 seconds" or a "wait till system is idle", giving the script enough time for the window to fully come up, then tell it to press the return key, or tell it to move the mouse's coordinates to the button's location, and then click the mouse.  Run this in an infinite loop, and it'll constantly wait for that window to come up, just to click it.  This won't really work if you're trying to use it as a desktop computer and running hotline server in the background though.  =\  With some monkeying around it might...  =P

 - Insolence
Actually the test bed is a desktop G4. The actual server is a new G5. I had no problem running the script manually, just by the time trigger. I did three steps: switch to the application, click in the title bar of the window with the button I need, then clicking the button. I'm currently running it via an Applescript that is run by a cron job. This works as long as the screen saver is not active. Could the screen saver be hosing Quickeys timer, too? One last question then I'll accept the answer and award the points: Is Quickeys language documented anywhere?

Thanks for your efforts!
ASKER CERTIFIED SOLUTION
Avatar of Insolence
Insolence

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
And you are quite welcome mwarbeck.  =)

 - I