Problems with ControlSend success rate?

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
viv
Posts: 217
Joined: 09 Dec 2020, 17:48

Problems with ControlSend success rate?

10 Oct 2021, 10:42

Each line of the script is executed separately without any problem
But executing them in succession will miss many steps
Even if I add "sleep" to every operation, it doesn't solve

The script manually sets the selection for the image
Then automatically sends the cut and paste and saves it to the specified location
it work for paint.net
Some Wintitle contain Chinese

Code: Select all

paintdotnet := "ahk_exe paintdotnet.exe"

A_Clipboard := "F:\Documents\Pictures\001 00412222.jpg"

ControlSend("^+x", ,paintdotnet), Sleep(100) ;crop image
ControlSend("^+s", ,paintdotnet), Sleep(100) ;saveas windows

WinWait(_saveAS := "另存为 " paintdotnet), ControlSend("^a^v", "Edit1", _saveAS), Sleep(100) ;paste path to saveas windows
while ControlGetText("Edit1", _saveAS) != A_Clipboard ;check if paste?
    ControlSend("^a^v", "Edit1", _saveAS), Sleep(100)
ControlSend("{Enter}", "Edit1", _saveAS), Sleep(100) ;enter for saveas windows


WinWait("保存配置"), ControlSend("{Enter}", ,paintdotnet), Sleep(100) ;enter for save configuration windows
WinWait("paint.net"),ControlSend("^w", ,paintdotnet), Sleep(100) ;close picture tag

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: mikeyww and 36 guests