Jump to content

Script sometimes skipping keystrokes / jumping to wrong cells


Recommended Posts

#include <Misc.au3>

If _ispressed ("{Enter}") then
 
Send ("{") 
Send ("ENTER")
Send ("}")

EndIf

play with that

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

unfortunately, there is a need that the enter key be pressed.

Your method works great, and it sends the values perfectly, but the application is weird in a sense that even if I set the values it needs enter to be pressed or it will not process the values. If I just move to the next cell it will automatically revert back to the old values.

Link to comment
Share on other sites

Ah.  Then that is one of the cases where the send might be required...stick with controlsend then.  There might be another _guictrllistview* to 'commit' or something similar.

An edit is created, right?  And you need to get out of it?

Get the handle via:

_GUICtrlListView_GetEditControl

And send the enter at that.

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

I've quickly scanned through the option because I have to run out. It looks promising, will get to work on it tomorrow. Thanks a lot for sticking with me and offering help, it is appreciated!

Really cool to see how Ive went from a sluggish macro to a quick short script :)

Link to comment
Share on other sites

I've tried getting the handle but the function does not allow me to enter the coordinates for the cell or the index of the cell. So far I gotten to this:

#include <GuiListView.au3>

;---------------------------------------
; Define Variables
;---------------------------------------
$windowTitle = "VTable 8.04 (COM3 [115200]) - [1: -  603 206 000 ; 12087363]"
$windowControlID = "[CLASS:SysListView32; INSTANCE:6]"
$hWin = WinGetHandle($windowTitle)
$hControl = ControlGetHandle($hWin,"",$windowControlID)

;--------------------------------------
; Start Script
;--------------------------------------
;--------------------------------------
; Index 1
;--------------------------------------
;Target Position value Index 1 in Vtable
$iRowToEdit = 0
$iSubItemToEdit = 2
_GUICtrlListView_SetItem($hControl,"100001",$iRowToEdit,$iSubItemToEdit)

$editControl = _GUICtrlListView_GetEditControl($hControl)
ControlSend($hWin,"",$editControl,"666666")

I've used "666666" just to see if the value is being sent but nothing happens. I thinks it's because it is now sending it to the window instead of using the rows and subitems values. I have no idea how to go from here, the example of GetEditControl is very confusing.

Edit:

When showing $editControl in the Console it shows a value of 00000000. When I use the script from jdelaneys sig (GetAllWindowControls) it shows the Handle as [0x000D04E8]. Neither works with ControlSend though.

Edited by Marss
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...