Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Autohotkey 如何在两个打开的Chrome窗口(2个监视器)之间切换以进行数据采集?_Autohotkey - Fatal编程技术网

Autohotkey 如何在两个打开的Chrome窗口(2个监视器)之间切换以进行数据采集?

Autohotkey 如何在两个打开的Chrome窗口(2个监视器)之间切换以进行数据采集?,autohotkey,Autohotkey,我的日常工作是在两台显示器上打开两个Chrome窗口,在右侧窗口复制数据,然后粘贴到左侧窗口 此脚本有时无法切换到其他窗口。我知道有一个名为WinActive的命令,但我使用的是同一个程序(谷歌浏览器),所以我不知道如何编写这个命令的脚本 请帮我修一下,它很不稳定 非常感谢您的阅读和时间 试试使用和。你能帮我吗?我试过了,但它循环了所有打开的选项卡,而不仅仅是我正在使用的两个窗口。GroupAdd,Chrome,ahk_类Chrome\u WidgetWin\u 1返回Numpad1::Gro

我的日常工作是在两台显示器上打开两个Chrome窗口,在右侧窗口复制数据,然后粘贴到左侧窗口

此脚本有时无法切换到其他窗口。我知道有一个名为WinActive的命令,但我使用的是同一个程序(谷歌浏览器),所以我不知道如何编写这个命令的脚本

请帮我修一下,它很不稳定


非常感谢您的阅读和时间

试试使用和。你能帮我吗?我试过了,但它循环了所有打开的选项卡,而不仅仅是我正在使用的两个窗口。GroupAdd,Chrome,ahk_类Chrome\u WidgetWin\u 1返回Numpad1::GroupActivate,Chrome,rIf如果您有两个以上的窗口,请尝试添加标题:GroupAdd,Chrome,title1 ahk_类Chrome\u WidgetWin\u 1 GroupAdd,Chrome,title2 ahk_类Chrome\u WidgetWin\u 1返回。
1::     ; Copy name, change Capital then separate Last and First
Send, {CTRL DOWN}c{CTRL UP}   ; Copy data
sleep, 20
send, {Alt Down}{TAB}{Alt Up}     ; switch to the other Chrome window
sleep, 20
send, {CTRL DOWN}f{CTRL UP}
SendInput First      ;This is how I find the box to move the cursor to click on it
sleep, 5
PixelSearch px, py, 0, 95, 1132, 1019, 0x3296ff, 3, Fast   ; Find the color (of the First above)
MouseMove, %px%, %py% ; move mouse to color coordinates
Click
Send, {CTRLDOWN}v{CTRLUP}
send, ^a      ; Select all text in the box
Clipboard := ""        ; Change capital letter and remove middle name
Send, ^c
ClipWait, 0
If ErrorLevel
Return
Sleep, 50
StringUpper str, Clipboard, T
head := SubStr( str, 1 , 1 )
tail := SubStr( str, 2 )
Clipboard := head RegExReplace( tail , "i)\b(de|an|and|in|the|with|of)\b", "$L1")
Clipboard := RegExReplace(Clipboard, "([A-Z][a-z]+) [A-Z][a-z]{0,2}\. ([A-Z][a-z]+)", "$1 $2")

Send, ^v
Send, {CTRL DOWN}{SHIFT DOWN}{LEFT DOWN}{SHIFT UP}{LEFT UP}x{CTRL UP}   ; Copy last name 
Send, {SHIFT DOWN}{TAB DOWN}{SHIFT UP}{TAB UP}{CTRL DOWN}v{CTRL UP}{TAB}{TAB}    ; bring last name to upper box,  then move to the third box

return