Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
842 views
in Technique[技术] by (71.8m points)

automation - How do I automate a Java application with AutoHotkey?

I use a Java application at work. I need to send clicks to buttons and fill in textboxes. I would like these actions to happen in the background. The ahk_class of the window is SunAwtFrame, and none of the controls are exposed to WindowSpy.

I have used JavaFerret to determine that the first button I want to press has an AccessibleAction

Version Information:
    Java virtual machine version: 1.7.0_25
    Access Bridge Java class version: 1.7.0_25
    Access Bridge Java DLL version: AccessBridge 2.0.2
    Access Bridge Windows DLL version: AccessBridge 2.0.2

AccessibleContext information:
    Name:  New Call
    Description:  Place a new call
    Role:  push button
    Role in en_US locale:  push button
    States:  enabled,focusable,visible,showing,opaque
    States in en_US locale:  enabled,focusable,visible,showing,opaque
    Index in parent:  1
    Children count:  0
    Bounding rectangle:  [288, 317, 385, 376]
    Top-level window name:  Phone Assistant: 
    Top-level window role:  frame
    Parent name:  
    Parent role:  panel
    Visible descendents count:  0

AccessibleIcons info:
    Number of icons:  1
    Icon 0 description: jar:http://proxy.m5net.com/vox/pa/receptioncenter.jar!/resources/phone.png
    Icon 0 height: 26
    Icon 0 width: 27

AccessibleActions info:
    Number of actions:  1
    Action 0 name: click

Accessible Value information:
    Current Value:  0
    Maximum Value:  1
    Minimum Value:  0

The accessibility docs tell me that I should be to tell the object to perform that action, but I don't know how to do this.

Preferably with AutoHotkey, how can this be done?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...