Controlling a JAVA Interface?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
JemyM
Posts: 44
Joined: 04 Jul 2017, 11:57

Controlling a JAVA Interface?

Post by JemyM » 18 Jul 2017, 13:12

Anyone with experience in controlling Java applications? Or a Spy alternative for Java apps? I have done some more advanced scripts that overlap programs and implement more advanced functions. However, I work at an office using the Opera Reservation System that primarily use a java interface that simply don't work with AHK Spy or any regular functions I rely on, like controlsend. The system is often slow and there is a lot I could do to improve my workflow if I could get AHK to retrieve and send data directly to the software without relying on mouse movement, scripted copy/paste etc.

Typical screen:
Image

User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Controlling a JAVA Interface?

Post by jeeswg » 18 Jul 2017, 16:33

Does AccViewer work at all?
Acc library (MSAA) and AccViewer download links - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26201
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

JemyM
Posts: 44
Joined: 04 Jul 2017, 11:57

Re: Controlling a JAVA Interface?

Post by JemyM » 18 Jul 2017, 17:49

jeeswg wrote:Does AccViewer work at all?
Acc library (MSAA) and AccViewer download links - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26201
I will bring these to work tomorrow and have a spin. :)

User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: Controlling a JAVA Interface?

Post by Xtra » 18 Jul 2017, 18:01

Search for keywords: Java access bridge

JemyM
Posts: 44
Joined: 04 Jul 2017, 11:57

Re: Controlling a JAVA Interface?

Post by JemyM » 19 Jul 2017, 01:37

Xtra wrote:Search for keywords: Java access bridge
I tried this. Without any documentation I had no clue what it was supposed to do or which files were actually needed.


Elgin
Posts: 124
Joined: 30 Sep 2013, 09:19

Re: Controlling a JAVA Interface?

Post by Elgin » 19 Jul 2017, 04:19

See my posts here
https://autohotkey.com/board/topic/9534 ... -java-app/
on how to use it with AHK.

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Controlling a JAVA Interface?

Post by BoBo » 19 Jul 2017, 04:42

Elgin wrote:See my posts here
https://autohotkey.com/board/topic/9534 ... -java-app/
on how to use it with AHK.
Hi Elgin,
thx for creating and sharing this extremely useful scripts! Much appreciated :thumbsup:
Question, are those initial (spoilered) scripts the most recent ones (have been updated finally)?

Thx for listening :)

JemyM
Posts: 44
Joined: 04 Jul 2017, 11:57

Re: Controlling a JAVA Interface?

Post by JemyM » 19 Jul 2017, 05:18

Accessible Info Viewer had no additional information. Acc Structure shows a menu and titlebar but no real content. I used the crosshair since Swedish keyboards have no "\" key.

Java Access Bridge appears to need installation of additional software. I can't install anything here. Is there any way for me to make the necessary files portable?

JemyM
Posts: 44
Joined: 04 Jul 2017, 11:57

Re: Controlling a JAVA Interface?

Post by JemyM » 20 Jul 2017, 02:36

Elgin wrote:See my posts here
https://autohotkey.com/board/topic/9534 ... -java-app/
on how to use it with AHK.
Elgin, is there any way to make that "portable"? I can't install stuff where I work.

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Controlling a JAVA Interface?

Post by BoBo » 20 Jul 2017, 03:57

https://m.youtube.com/watch?v=q5gnjGrMFtw
https://portableapps.com/development

If you prefer to build a portable app (AKA "package") using VMware's ThinApp check this out ...
https://m.youtube.com/watch?v=uPKjrrhIpN0&t=17m56s

Elgin
Posts: 124
Joined: 30 Sep 2013, 09:19

Re: Controlling a JAVA Interface?

Post by Elgin » 20 Jul 2017, 12:29

Hi JemyM, Bobo,

the version there is the most recent that's tested. I started on a class based version long time ago but can't seem to get around to finishing it...

If you need to install anything depends on your Java version. Older versions (JRE6 ?) need the additional installation, in halfway recent versions you can simply turn this feature on as it's part of the normal Java package:
https://docs.oracle.com/javase/9/access ... F5AC0AEE8E
unless your admins blocked that, too.

User avatar
tank
Posts: 3122
Joined: 28 Sep 2013, 22:15
Location: CarrolltonTX
Contact:

Re: Controlling a JAVA Interface?

Post by tank » 20 Jul 2017, 12:38

Sun have developed a Java Access Bridge, which contains DLLs to read Java windows ..
http://java.sun.com/products/accessbridge/
API documentation is here ..
http://java.sun.com/products/accessbridge/docs/api.html
JavaFerret is a simple app, that reads java screens ...
http://java.sun.com/products/accessbrid ... erret.html
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter

DavidCooper
Posts: 1
Joined: 07 Mar 2018, 10:45

Re: Controlling a JAVA Interface?

Post by DavidCooper » 07 Mar 2018, 11:00

Would like to add here one another thing, it will come in handy if you need to get to know some background info on cotrolling applications runned with java as well as for guys who are on their top of the beginning with learn java https://explainjava.com/. This is the very resource I'd started my way through the basics with. The point is, java is not the best option when you choose programming language to learn with zero experience in coding and backend itself, so the materials provided here will make the process less painful in some way. Literally, there are answers on all the common questions and mistakes stored, and it written in call-it explain-me-like-im-5 fashion, so it will be easy to get even when the highest point of your programming skills is the rock paper scissors game coded in js or something.

sergiogold
Posts: 1
Joined: 08 Apr 2019, 16:21

Re: Controlling a JAVA Interface?

Post by sergiogold » 08 Apr 2019, 16:31

Dear JemyM,
searching the web I found your Opera PMS screen with EXACTLY the same issue that I'm trying to achieve.
Basically insert reservations into Opera through the use of AHK.
Have you been successful trying this?
Were you able to identify the java screens in order to insert the proper data?

Thanks for your help.

rc76
Posts: 144
Joined: 07 Nov 2020, 01:45

Re: Controlling a JAVA Interface?

Post by rc76 » 27 Sep 2021, 21:34

Dear @Elgin

If possible, I would like to seek your help on the Thinkorswim Java app on Windows.

I have tried to access it either by Access Bridge, but it seems just cannot get any info on the App.

I have installed:
- Windows 10
- JRE8
- Enabled Java Access Bridge on Windows 10 via Ease of Access Center

How I tested it is using:
(1) accessbridge2_0_2's JavaFerret.exe
(2) Access bridge Explorer (https://github.com/google/access-bridge-explorer)

But both of above doesn't work as no feedback when mouse clicking the TOS app:
00.png
00.png (332 KiB) Viewed 1823 times
Is there anything I am missing here?

Elgin
Posts: 124
Joined: 30 Sep 2013, 09:19

Re: Controlling a JAVA Interface?

Post by Elgin » 09 Oct 2021, 04:44

Hi!

Sorry for the late reply. It seems I don't get notified about replies by mail anymore.

There might be a number of things (I don't have TOS and have no plan to sign up just for testing either):
- TOS comes with its own JRE according to their download website. You need to find that version, check if they have included all the necessary dll and jar files for accessibility in 32 and 64 bit (for example the Zulu JRE is missing the other bitness by default; they might also miss the dlls in the windows system folders) or make really sure that everything is in the same bitness (might still create problems, so having all files is the easiest).
- make sure that TOS's JRE has the accessibility enabled. This setting is separate for each JRE (use the "accessibility.properties" file if you're not sure).
- From the looks, TOS may use custom UI elements in which case accessibility will likely not work or just very limited, depending on if they cared for it when programming or not. Try if you get something with Java Monkey first. If there are no accessible UI elements, they can't notify you that they've been clicked either...

Good luck!

rc76
Posts: 144
Joined: 07 Nov 2020, 01:45

Re: Controlling a JAVA Interface?

Post by rc76 » 11 Oct 2021, 10:06

Thank you so much @Elgin, I think you are very correct, TOS has too many custom UI elements that makes it nearly impossible to do much beside mouse clicks.

Post Reply

Return to “Ask for Help (v1)”