열려 있는 모든 PDF 문서를 동시에 스크롤하는 스크립트를 만들려고 합니다. 문제는 스크롤해야 하는 각 창의 이름을 구체적으로 지정하고 해당 창에 작업을 보내지 않으면 작동하도록 할 수 없다는 것입니다. 또한 현재 상태에서는 다른 창(예: 메모장)에서 스크롤 이벤트를 포착해야 하지만 일부 PDF를 수동으로 스크롤한 다음 동기 스크롤을 다시 시작할 수도 있으므로 실제로는 괜찮습니다.
내 작업 흐름은 다음과 같습니다.
- 2개 이상의 PDF 문서를 엽니다.
- 메모장 파일을 열고 메모장 파일로 스크롤을 시작합니다.
결과: 열려 있는 모든 PDF가 스크롤되기 시작합니다.
내 코드는 다음과 같습니다(interwebz에서 빌림).
WheelDown::
SetTitleMatchMode, 2
IfWinActive, Notepad ; Replace 'SafariTitle' by the title of the safari windows
{
CoordMode, Mouse, Screen
WinGet, active_id, ID, A
IfWinExist, Adobe
{
Send {WheelDown}
WinActivate ; Automatically uses the window found above.
Send {WheelDown}
Send {WheelDown}
WinActivate, ahk_id %active_id%
}
}
Else
{
Send {WheelDown}
}
return
WheelUp::
SetTitleMatchMode, 2
IfWinActive, Notepad ; Replace 'SafariTitle' by the title of the safari windows
{
CoordMode, Mouse, Screen
WinGet, active_id, ID, A
IfWinExist, Adobe
{
Send {WheelUp}
WinActivate ; Automatically uses the window found above.
Send {WheelUp}
Send {WheelUp}
WinActivate, ahk_id %active_id%
}
}
Else
{
Send {WheelUp}
}
return
지금은 하나의 PDF만 스크롤하는 데 작동합니다.
어떻게 하면 모든 항목을 보고 스크롤할 수 있나요?
답변1
해결책을 찾았습니다.
WheelDown::
SetTitleMatchMode, 2
IfWinActive, Notepad ;
{
CoordMode, Mouse, Screen
WinGet, active_id, ID, A
WinGet, id, list, Adobe,, Program Manager
Loop, %id%
{
Send {WheelDown}
this_id := id%A_Index%
WinActivate, ahk_id %this_id%
Send {WheelDown}
Send {WheelDown}
WinActivate, ahk_id %active_id%
}
}
Else
{
Send {WheelDown}
}
return
WheelUp::
SetTitleMatchMode, 2
IfWinActive, Notepad ;
{
CoordMode, Mouse, Screen
WinGet, active_id, ID, A
WinGet, id, list, Adobe,, Program Manager
Loop, %id%
{
Send {WheelUp}
this_id := id%A_Index%
WinActivate, ahk_id %this_id%
Send {WheelUp}
Send {WheelUp}
WinActivate, ahk_id %active_id%
}
}
Else
{
Send {WheelUp}
}
return
이제 작동합니다. Adobe Acrobat Reader(또는 acrobat Pro, acrobat 포함)와 메모장이 필요합니다.
작동 방식:
동기적으로 스크롤하려는 PDF를 엽니다.
하나의 메모장 창을 엽니다(이것이 제어 창이므로 PDF를 자동으로(각각 개별적으로) 스크롤할 수도 있습니다. 메모장 창의 크기를 아주 작게 조정할 수 있습니다.
메모장 창을 클릭하고 스크롤합니다.
메모장 창에서 스크롤하면 각 PDF가 선택되고 스크롤됩니다. PDF만 스크롤하려면 각 PDF를 수동으로 선택하세요.
답변2
메모장 창이 필요하지 않은 간단한 솔루션은 다음과 같습니다. 창 제목을 "Adobe Reader"에서 acrobat 창 제목으로 변경해야 할 수도 있습니다. 이것은 "Adobe Reader"라는 모든 창을 반복하고 CTRL-SHIFT-N을 눌러 페이지 번호를 증가시킵니다.
SetTitleMatchMode 2 ; Match anything with Adobe Reader anywhere in the title
WinGet, id, list,Adobe Reader,, Program Manager
this_id := id1 ; Activate the first window, and find the current page number
WinActivate, ahk_id %this_id%
WinWaitActive, ahk_id %this_id%
Send, {CTRLDOWN}N{CTRLUP}
Sleep, 30
WinGetText, text ;
StringSplit, word_array, text, `n ; The current page number is on the 3rd line of returned text
nextpage := word_array3
nextpage += 1 ; Increment and store the current page number
Send, %nextpage%{ENTER}
Sleep, 30
Loop, %id% ; now loop through the rest of the windows and set each to the same page.
{
this_id := id%A_Index%
WinActivate, ahk_id %this_id%
WinWaitActive, ahk_id %this_id%
Send, {CTRLDOWN}N{CTRLUP}
Sleep, 30
Send, %nextpage%{ENTER}
Sleep, 30
}
답변3
2014년 2월 28일 Brett Bymaster 스크립트를 시도했는데 완벽하게 작동했다는 점을 언급하고 싶었습니다.
그런 다음 전체적으로 "WheelDown"을 "PgDn"으로, "WheelUp"을 "PgUp"으로 변경하여 수정했습니다. 이렇게 하면 마우스 휠을 사용하여 몇 페이지를 스크롤하는 대신 PgUp 및 PgDn 키를 사용하여 한 번에 한 페이지를 스크롤할 수 있습니다. 한 번에 한 줄씩 - 제가 찾던 바로 그 것입니다. 저는 한 쌍의 PDF를 매우 빠르게 검토하면서 거의 동일한지 시각적으로 확인하고 차이점을 찾아낼 수 있었습니다.
이 접근 방식은 개별 Adobe 창을 클릭하여 문서를 별도로 스크롤할 수 있는 기능이 훌륭합니다. 왜냐하면 (1) 페이지별로 동기화 스크롤이 중단되는 경우가 있었기 때문입니다(아마도 키를 너무 빨리 누르는 것 같습니다). 다시 동기화하려면 (2) 반드시 같은 페이지에 정렬되어 있지 않은 2개의 서로 다른 PDF에서 유사한 섹션을 선택하여 비교할 수 있습니다.
좋은 내용이고 감사합니다!