Jump to content
dorel

Autoit reading text from Java window - (Moved)

Recommended Posts

dorel

HI,

I'm trying to get a text value from simple Java window (even from some text demo from oracle).

First I was using Java UDF from this forum, but it's not working, "_JavaObjValuesGet" gives me nothing.

Then i have found this:

https://www.autoitscript.com/forum/topic/87956-java-udf/?do=findComment&comment=1216556

 

is there a person who could tell me how to implement into this script some simple text reading, From JAB api i.e. 

 

BOOL GetAccessibleTextInfo(long 199730, AccessibleText at, AccessibleTextInfo *textInfo, jint 1921, jint 1);

 

Share this post


Link to post
Share on other sites
Melba23

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
dorel

BUMP

JAB API documentation:

 

BOOL GetAccessibleTextItems(long vmID, AccessibleText at, AccessibleTextItemsInfo *textItems, jint index);

struct AccessibleTextItemsInfo {
 wchar_t letter;
 wchar_t word[SHORT_STRING_SIZE];
 wchar_t sentence[MAX_STRING_SIZE];
};

 

I'm recreating steps from original script:
 

const $TypeStructAccessibleTextItemsInfo="WCHAR letter[32];WCHAR word[256];WCHAR sentence[1024]"
Local $AccessibleTextItemsInfo=DllStructCreate($TypeStructAccessibleTextItemsInfo)

my problem starts here:

$result2 = dllcall($bridgeDLL, "BOOL:cdecl","GetAccessibleTextItemsInfo","long", $vmId, ??WHAT INSERT HERE?? )


i have no idea what i must insert in the above.

 

Share this post


Link to post
Share on other sites
dorel
Posted (edited)

This script was crashing, i changed the path to DLL to  "C:\Windows\System32\WindowsAccessBridge-64.dll". Now it works when I run it from AutoIt3_x64.exe.

I have made "my script" inside jabsimplespy to look like this.

const $TypeStructAccessibleTextItemsInfo="WCHAR letter[256];WCHAR word[256];WCHAR sentence[1024]"
Local $AccessibleTextItemsInfo=DllStructCreate($TypeStructAccessibleTextItemsInfo)

local $at
local $indextext
$result2 = dllcall($hAccessBridgeDll, "BOOL:cdecl","GetAccessibleTextItemsInfo","long", $vmId, "long",$at ,"struct*" ,$AccessibleTextItemsInfo, "long", $indextext  )
$AccessibleTextItemsInfo =$result2[1]

Now I'm getting "subscript used on non-accessible variable" on $result2[0], $result2[1], $result2[2]. So I'm thinking.. dllcall is not working properly and thats why $result2 gives nothing. I'm still in the same spot I was earlier ;(

 

edit:

My normal result is like this:

Mouse position is retrieved 2729-774
  JAVA window found <> Java Window Title= Handle=0x00000000000116D6     res: 1
Result getAccessibleContextFromHWND is <> ubound: 4
  We have a VMid 132182 ac 1430183872
Call version info: PASSED VMID found : 132182
  VMVersion: <1.8.0_91>
  bridgeJavaClassVersion: <1.8.0_91>
  bridgeJavaDLLVersion: <1.8.0_91>
  bridgeWinDLLVersion: <1.8.0_91>
 *** getAccessibleContextAT result is <1430183824>
 *** getAccessibleContextAT result is <1430183824>


text
text
focusable,visible,showing,editable,single line
focusable,visible,showing,editable,single line
0
0
2697
763
184
0
End of getAcceccibleContextAt info

 

Edited by dorel
added info from jabsimplespy

Share this post


Link to post
Share on other sites
careca

Maybe OCR, Tesseract for example.


Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×