Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Java Accessible Object Dialog Problem
#1
Greetings. I am using Quick Macro v2.4.5 (for the first time Smile ) in the hopes to automate a Java JNLP file to print a page inside using solely non-keyboard/mouse actions so that I can run it in the background and on a lock computer. But I have encountered problems with QM recognising subsequent dialog boxes if these are opened by QM accessible object actions.

I have Java (32-bit) installed, have enabled Java Access Bridge and can use accessible objects to find whatever buttons I need to find during the initial programming phase. The only action I have used is "DoDefaultAction" as these buttons are push buttons.

One example:
So the problem is that if I use QM accessible object actions (per below script) to open a dialog box (say, Help -> About), the "About" dialog box will open/show. But there is something strange with the opened "About" dialog box. The "Close" button in the opened "About" dialog box cannot be clicked via the last section of the codes below and return an error "Error (RT) in Macro 1: object not found. ?" at the 'Acc a2' line. For other dialogs, it sometimes works but with a great amount of delay.

Code:
Copy      Help
int w=win("Login - Java Terminal" "SunAwtFrame")
Acc a.Find(w "menu" "Help" "" 0x1001)
a.DoDefaultAction
Acc a1.Find(w "menu item" "About" "" 0x1001)
a1.DoDefaultAction

int w1=win("About Java Terminal" "SunAwtDialog")
Acc a2.Find(w1 "push button" "Close" "" 0x1001)
a2.DoDefaultAction

So the thread ended. Now on the already open "About" dialog (opened using the previous/above QM accessible object action - DoDefaultAction), if I use QM to find accessible objects, it seems like only the windows can be found and not individual objects within the window. The QM program then hung badly. For the times it managed to recover, instead of being able to locate the dialog object, it ends up showing some WINDOW (SunAwtDialog). This is unlike the initial programming phase where I manually opened the dialog in the JNLP program prior to using QM to (successfully) find these accessible objects.
Also, on the already open "About" dialog (opened using the previous/above QM accessible object action - DoDefaultAction), I am able to use my mouse to interface directly with the JNLP program to manually click the "Close" button to close the "About" dialog box.


Now if I use keyboard actions in QM (per below script) to open the "About" dialog box, the same QM accessible object actions in 'Acc a2' line was able to find and execute the "Close" button within the "About" dialog box and thereby closed this dialog without delay.

Code:
Copy      Help
int w=act(win("Login - Java Terminal" "SunAwtFrame"))
'Ah             ;; Alt+H
'Aa             ;; Alt+A

int w1=win("About Java Terminal" "SunAwtDialog")
Acc a2.Find(w1 "push button" "Close" "" 0x1001)
a2.DoDefaultAction

Also, this problem is only encountered on "SunAwtDialog" class (and if this dialog was opened using QM accessible object actions). It does not occur on "SunAwtFrame" class regardless of the method used - mouse, keyboard or accessible object actions.

Any advice on a workaround to this issue? I would strongly prefer to get the "accessible object" method to work rather than requiring to unlock the computer and using keyboard actions. Otherwise are there any other methods to click dialog box buttons using non-keyboard/mouse actions?
Thanks.


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)