Reputation: 1309
I have a Java application that I want to bring to the front at regular intervals, but I haven't been able to do this.
[Aside to people wanting to offer user interface advice. Yes, this is normally horrible, but I'm the only one using the app. It's my time&billing app, and I'm tired failing to record billable hours!]
I've tried with AppleScript, and have no problem getting Firefox to do this, with the following script:
tell application "Firefox"
repeat
activate
delay 10
end repeat
end tell
But I don't know how reference a Java app in AppleScript (that is, I don't know what to put for the appication's name).
tell application "java"
doesn't work (and there may be several Java apps running). tell application "NameShowingInMenu"
doesn't work, either.Any ideas?
Upvotes: 2
Views: 1140
Reputation: 1309
I was able to do this, using the "Jar Bundler" app, which is included with Max OS X.
Once I packaged my code using that, it behaved as a standard mac application and the script in my original question worked with no problems.
Upvotes: 2
Reputation: 8128
If you can do this in the Java app itself, you could get a hint from:
How to bring a window to the front?
Upvotes: 0