dorel Posted June 28, 2018 Posted June 28, 2018 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);
Moderators Melba23 Posted June 28, 2018 Moderators Posted June 28, 2018 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
dorel Posted June 29, 2018 Author Posted June 29, 2018 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.
junkew Posted June 29, 2018 Posted June 29, 2018 Search jabsimplespy FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
dorel Posted July 3, 2018 Author Posted July 3, 2018 (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 July 3, 2018 by dorel added info from jabsimplespy
junkew Posted July 3, 2018 Posted July 3, 2018 (edited) I assume yor $at is not initialized and most likely that should be getAccessibleContextAT value Edited July 3, 2018 by junkew FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
junkew Posted July 3, 2018 Posted July 3, 2018 Maybe good to search for jsacc.pdf and read that guide. Based on the example jabsimplespy it should not be that hard to convert it to au3 code. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
careca Posted July 3, 2018 Posted July 3, 2018 Maybe OCR, Tesseract for example. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders 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. 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now