ControlSend pressing Shift during send?
Posted: 16 Oct 2018, 17:18
I'm using COM to send values from Excel into the command prompt, and sometimes during ControlSend, it appears that AHK is pressing shift.
For example, is getting sent as
The full code I am sending is below. Is there some kind of Send parameter I need to define to prevent this from happening
For example,
Code: Select all
start %windir%\explorer.exe
Code: Select all
start %windir5|explorer.exe
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
!^i::
xl := ComObjCreate("Excel.Application")
xl.Visible := true
FilePath := "C:\Users\folder\file.xlsx"
xl.Workbooks.Open(FilePath)
values := {}
for Cell in Xl.Range("A1:A5").Cells
if !(Cell.text="")
Values.Push(Cell.Text)
xl.Quit
SetKeyDelay , 30
run cmd.exe
for key, val in values
{
WinActivate, ahk_exe cmd.exe
WinWait, ahk_exe cmd.exe
ControlSendRaw ,, % val, ahk_exe cmd.exe
WinWait, ahk_exe cmd.exe
ControlSend ,, {enter}, ahk_exe cmd.exe
WinWait, ahk_exe cmd.exe
}
MsgBox, DONE