-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpdfreader.ahk
More file actions
699 lines (549 loc) · 17.8 KB
/
pdfreader.ahk
File metadata and controls
699 lines (549 loc) · 17.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
; Note: This file is saved with UTF8 with BOM, which is the best encoding choice to write Unicode chars here.
AUTOEXEC_pdfreader: ; Workaround for Autohotkey's ugly auto-exec feature. Must be first line.
; Something to place here.
; * Customize these global vars according to your running machine:
; * Call the run-once functions.
; Example
;g_dirEverpic = D:\chj\scripts\everpic
global FOXIT_TOOL_Hand := "Hand"
global FOXIT_TOOL_SelectAnnotation := "SelectAnnotation"
global FOXIT_TOOL_SelectText := "SelectText"
global g_foxit_last_tool := "none" ; compare it with FOXIT_TOOL_Hand, FOXIT_TOOL_SelectText or FOXIT_TOOL_SelectAnnotation
; Init_MyCustomizedEnv() ; Function can be defined later.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
return ; End of auto-execute section.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#Include %A_LineFile%\..\libs\chjfuncs.ahk
/* Customization:
; User can define PdfReaderCfg.Foxit7PaletteWaitMillisec etc in custom_env.ahk .
class PdfReaderCfg
{
static Foxit7PaletteWaitMillisec := 300
}
*/
;==============================================================
; 2015-01-05: Foxit Reader 7, 9 shortcuts
;==============================================================
foxit_ScrollReader(sdir)
{
; sdir should be "up" or "down"
isok := RegexClassnnFindControlEx("ahk_class classFoxitReader", "^AfxWnd100su", "^Reader$", reader_classnn)
if(not isok)
{
return
}
ControlClick, % reader_classnn, ahk_class classFoxitReader, , Wheel%sdir%, 1
}
foxit2_GetMainWindow()
{
; `2` implies: both Foxit Reader and Editor.
hwnd := dev_GetHwndByClass("classFoxitReader")
if(hwnd)
return hwnd
hwnd := dev_GetHwndByClass("classFoxitPhantom")
if(hwnd)
return hwnd
return ""
}
foxit_IsWinExist()
{
hwnd := foxit2_GetMainWindow()
if(WinExist("ahk_id " hwnd)) ; call WinExist() so to update Last Found Window
return true
else
return false
}
foxit_IsWinActive()
{
hwnd := foxit2_GetMainWindow()
if(WinActive("ahk_id " hwnd)) ; call WinActive() so to update Last Found Window
return true
else
return false
}
foxit_IsEditor11Active()
{
if(dev_IsExeActive("FoxitPDFEditor.exe"))
return true
else
return false
}
foxit_IsFoxit7_ForegroundProcess()
{
WinGet, Awinid, ID, A ; cache active window unique id
WinGet, exepath, ProcessPath, ahk_id %Awinid%
if(StrIsEndsWith(exepath, "FoxitReader.exe"))
return true
if(StrIsEndsWith(exepath, "FoxitPhantomPDF.exe"))
return true
return false
}
foxit_IsAnnoationPropertyWindowActive()
{
; Note: Foxit 9+, which is Ribbon-only, no longer has this floating Property window.
if(! foxit_IsFoxit7_ForegroundProcess())
return false
WinGet, Awinid, ID, A ; cache active window unique id
; WinGetClass, class, ahk_id %Awinid%
WinGetTitle, title, ahk_id %Awinid%
if( title ~= ".+ Properties$" || title ~= ".+ 属性$" )
return true
else
return false
}
foxit_IsVersion7(wintitle="A")
{
isfound := RegexClassnnFindControlEx(wintitle, "^AfxWnd100su", "", target_classnn)
if(isfound)
return true
else
return false
}
foxit_copynow(is_wait_until_mainwnd_foreground:=false)
{
Send ^c
if(is_wait_until_mainwnd_foreground)
{
; After user press Ctrl+c, Foxit reader may popup a progress-bar at right-bottom corner
; which lasts for about 10~100ms(more text, longer wait). During this time, hotkeys
; for marking underline, Squiggly is not effective.
; So, we wait until the main-window re-gains input-focus is required.
;
hwnd := foxitR_GetMainWindow()
dev_WinWaitActiveHwnd(hwnd, 500)
}
}
foxitR_GetMainWindow()
{
hwnd := dev_GetHwndByWintitle("ahk_class classFoxitReader")
if(!hwnd) {
dev_MsgBoxInfo("foxitR_ActivateMainWindow() Not found: ""ahk_class classFoxitReader"".")
return false
}
return hwnd
}
foxitR_ActivateMainWindow()
{
hwnd := foxitR_GetMainWindow()
if(!hwnd)
return
dev_WinActivateHwnd(hwnd)
return dev_WinWaitActiveHwnd(hwnd, 500)
}
#If foxit_IsAnnoationPropertyWindowActive()
ESC:: foxit_NoEscClosePropertiesDlgbox()
foxit_NoEscClosePropertiesDlgbox()
{
; [2023-04-07] Great job! From today on, I will NOT be afraid that
; striking ESC key(one or multi times) will close Foxit reader 7.1.5's
; comment-Property dialog. Instead, ESC brings me back to Foxit main window.
dev_TooltipAutoClear("ESC key no closing Foxit comment Properties Dlgbox")
; But activate Foxit Reader main-window.
if(not foxitR_ActivateMainWindow()) {
dev_TooltipAutoClear("foxitR_ActivateMainWindow() failed.")
return
}
foxit_MakeMainWindowFreeScrolling()
}
Enter:: foxit_EnterNoCloseCommentProperties()
foxit_EnterNoCloseCommentProperties()
{
dev_TooltipAutoClear("ENTER key no closing Foxit comment Properties Dlgbox")
}
#If
#If foxit_IsWinActive()
ESC:: foxit_MakeMainWindowFreeScrolling()
foxit_MakeMainWindowFreeScrolling()
{
; [2023-04-07] Great job! After user press ESC key, user can then
; press UP/DOWN key to scroll the page. Tested on Foxit Reader 7.1.5 .
;
; I have to simulate SelectTextMode then SelectHandMode, bcz:
; If currently I have a comment object(e.g. Squiggly line) selected(=highlight)
; UP/DOWN will not take effect. "SelectTextMode then SelectHandMode" unlocks it.
if(Is_PinyinJiaJia_Floatbar_Visible())
{
Send, {Esc}
return
}
foxitHotkey_SelectTextMode()
Sleep, 50
foxitHotkey_SelectHandMode()
}
F1:: Foxit_F1_Paste()
Foxit_F1_Paste()
{
dev_TooltipAutoClear("Foxit reader: F1 paste text.")
SendInput ^v
}
F8:: SendInput +^{Tab}
F9:: SendInput ^{Tab}
; Chj prefer Ctrl+] to execute Comment->Typewriter (right hand).
; And to make my left hand execute this, I summon Alt+Z to do so as well.
!z:: dev_SendInput("^]")
; Alt+. sends a big bullet character to act as unordered list bullet.
!.:: dev_SendInput("•")
$F5:: Foxit_HkToggleBookmarkSidebar()
Foxit_HkToggleBookmarkSidebar()
{
if(foxit_IsVersion7())
{
SendInput {F5} ; Relay F5, which is [Navigation Panels -> Bookmarks]
}
else
{
; On Foxit 9+, (buggy) Configuring F5 to [Navigation Panels -> Bookmarks]
; takes no effect, so I have to choose Ctrl+F5 as its shortcut.
SendInput ^{F5}
}
}
foxitHotkey_SelectTextMode(){
g_foxit_last_tool := FOXIT_TOOL_SelectText
Send !1 ; Alt+1
}
foxitHotkey_SelectAnnotationMode()
{
g_foxit_last_tool := FOXIT_TOOL_SelectAnnotation
Send !2 ; Alt+2
}
foxitHotkey_SelectHandMode()
{
g_foxit_last_tool := FOXIT_TOOL_Hand
Send !3 ; Alt+3
}
foxitHotkey_UnderlineText()
{
foxit_copynow(true)
Send ^-
}
foxitHotkey_SquiggleText()
{
foxit_copynow(true)
Send ^{=}
; Writing ^= does not take effect, adding the curly brackets makes it ok,
; just don't know the reason. Autohotkey 1.1.19.02
}
foxitHotkey_HighlightText()
{
foxit_copynow(true)
Send ^'
}
foxitHotkey_TypeWriterReady()
{
Send ^]
}
CapsLock & Left:: foxit_FocusBookmarkPane()
foxit_FocusBookmarkPane()
{
fnobj := Func("foxit_ClickAroundClassnn").Bind("xi,yi", 0.5, 0.5)
foxit_FindBookmarkPane(fnobj)
dev_TooltipAutoClear("Clicked Foxit Reader 7 Bookmarks pane.")
}
^`:: foxit7_TocSync()
foxit7_TocSync()
{
; This action is only effective when Foxit Reader 7's "Bookmarks" pane and Status-bar is visible.
rgbobj := { }
fnobj := Func("foxit_GetPixelColorAroundClassnn").Bind("xi,yo", 85, -15, rgbobj)
isok := foxit_FindBookmarkPane(fnobj)
if(!isok)
return
; Workaround a Foxit Reader 7.1.5 bug: On first open of a pdf, the [Expand Current Bookmark](tocsync) button
; keeps greyed out, until we click a bookmark. So, to activate the tocsync-button, we have to enforce
; a click into the TOC pane at (75, 8), in hope that we click some bookmark there.
;AmDbg0("foxit7_TocSync() see rgb=" rgbobj.rgb)
if(dev_IsGreyPixel(rgbobj.rgb))
{
rx := 75
ry := 8
dev_TooltipAutoClear(Format("Foxit7 TOC sync bug workaround: jump to some TOC entry then jump back... R({},{})", rx, ry))
; [1] Click first top-visible bookmark.
fnobj := Func("foxit_ClickAroundClassnn").Bind("xi,yi", rx, ry)
foxit_FindBookmarkPane(fnobj)
; Sigh, we need to pause a second. Without a pause, clicking on a bookmark(e.g. [TLPI] COVER)
; may not light up the tocsync-button.
Sleep, 900
; [2] Click the Navigate-back small button on the bottom status bar.
foxit7_Click_StatusbarNaviBack()
}
; [3] Click [Expand Current Bookmark](tocsync) button, which is at top of the Bookmarks pane.
fnobj := Func("foxit_ClickAroundClassnn").Bind("xi,yo", 85, -15)
foxit_FindBookmarkPane(fnobj)
}
foxit_GetPixelColorAroundClassnn(xymode, xspec, yspec, rgbobj, classnn) ; Can be a generic func?
{
Awinid := dev_GetActiveHwnd()
r := dev_ControlGetPos_hc(Awinid, classnn)
is_xomode := InStr(xymode, "xo") ? true : false
is_yomode := InStr(xymode, "yo") ? true : false
offsetx := NewCoordFromHint(r.x, r.w, xspec, is_xomode)
offsety := NewCoordFromHint(r.y, r.h, yspec, is_yomode)
;AmDbg0(Format("{},{} {},{} // offsetx={} , offsety={}", r.x,r.y, r.w,r.h, offsetx, offsety))
rgbobj.rgb := dev_PixelGetColor(offsetx, offsety)
}
foxit_ClickAroundClassnn(xymode, xspec, yspec, classnn)
{
; is_click := false ;xxxx true
; is_movemouse := true ;xxxx false
is_click := true
is_movemouse := false
dev_ControlFocusViaRegexClassNNXY(classnn, "", xymode, xspec, yspec, is_click, is_movemouse)
}
foxit_FindBookmarkPane(fnobj)
{
bookmark_ok := RegexClassnnFindControl("^ControlBar:", "^Bookmarks$", classnn_bookmark, x,y,w,h)
if(not bookmark_ok)
{
dev_MsgBoxWarning("Cannot find Foxit Bookmarks pane.")
return false
}
if(bookmark_ok)
{
treeviews := RegexClassnnFindControls("^SysTreeView32", "")
; tooltip, %x% / %y% / %w% / %h%
; tooltip, % "treeviews " . treeviews.MaxIndex()
for index, ctrl in treeviews
{
; MsgBox, % ctrl.x . "/" . ctrl.y . "/" . ctrl.w . "/" . ctrl.h ; debug
if(Is_RectA_in_RectB(ctrl.x,ctrl.y,ctrl.w,ctrl.h , x,y,w,h, 2))
{
fnobj.call(ctrl.classnn)
return true
}
}
}
dev_MsgBoxWarning("Cannot find Foxit Bookmarks treeview.")
return false
}
; ^\:: foxit7_Click_StatusbarNaviBack() ; just test
foxit7_Click_StatusbarNaviBack()
{
fnobj := Func("foxit_ClickAroundClassnn").Bind("xo,yi", 84, 14)
foxit7_FindStatusbarPagenumEditbox(fnobj)
}
foxit7_FindStatusbarPagenumEditbox(fnobj)
{
statusbar_ok := RegexClassnnFindControl("^BCGPRibbonStatusBar:", "", classnn_statusbar, x,y,w,h)
if(statusbar_ok)
{
edits := RegexClassnnFindControls("^Edit", "")
for index, ctrl in edits
{
if(Is_RectA_in_RectB(ctrl.x,ctrl.y,ctrl.w,ctrl.h , x,y,w,h, 2))
{
fnobj.call(ctrl.classnn)
isok := true
break
}
}
}
if(not isok)
{
MsgBox, % msgboxoption_IconExclamation,
, % "Cannot find Foxit Statusbar -> Pagenumber Editbox."
}
}
CapsLock & Right:: foxit_FocusReaderPane()
foxit_FocusReaderPane()
{
if(foxit_IsVersion7())
{
ControlFocusViaRegexClassNNXY("^AfxWnd100su", "^Reader$", 24, 0.5, true, true)
; true, true: will move mouse and click into the pane
}
else
{
ControlFocusViaRegexClassNNXY("^AfxMDIFrame140su", "", 24, 0.5, true, true)
}
}
NumpadMult:: foxitHotkey_HighlightText()
NumpadSub:: foxitHotkey_UnderlineText()
NumpadAdd:: foxitHotkey_SquiggleText()
NumLock:: foxitHotkey_SelectHandMode()
^w:: dev_TooltipDisableCloseWindow("Ctrl+W")
^q:: dev_TooltipDisableCloseWindow("Ctrl+Q")
vkE2:: foxit_AltW() ; vkE2 is the Central Europe extra \ key at the left-side of 'Z'.
;!w:: foxit_AltW()
; -- [2024-01-27] Weird, Alt+W hotkey high-probably causes FoxitReader 7 to loose
; PYJJ visual bar on FoxitReader App window title, so I trend to use vkE2 today.
foxit_AltW()
{
; dev_TooltipAutoClear("Alt+W")
dev_WaitKeyRelease("Alt")
foxitHotkey_TypeWriterReady()
}
#If ; #If foxit_IsWinActive()
#If foxit_IsAnnoationPropertyWindowActive() or (foxit_IsWinActive() and !foxit_IsEditor11Active())
NumpadDiv:: foxit_SwitchTo_SelectText_mode()
foxit_SwitchTo_SelectText_mode()
{
if(not foxitR_ActivateMainWindow()) {
dev_TooltipAutoClear("foxitR_ActivateMainWindow() failed.")
return
}
foxitHotkey_SelectTextMode()
}
^F12:: foxit7_ClickTextColorSelection()
F12:: foxit_ClickColorProperty() ; The hotkey I have used since 2015
!q:: foxit_ClickColorProperty() ; for left-hand ease (2023.04)
; -- Note: This foxit_ClickColorProperty(), not Ex, is used when:
; the comment object is selected, but the mouse is not hovering on it.
NumpadEnter:: foxit_ClickColorPropertyEx() ; for easier human right-hand hotkey activating (2023.04)
foxit_ClickColorPropertyEx()
{
; [2023-04-07] New: User only has to hover mouse pointer on a comment object
; (Underline, Squiggly, Strikeout etc), then call this function to popup
; color selection box. Yes, no longer need to manally click on the comment object.
if(not foxitR_ActivateMainWindow()) {
dev_TooltipAutoClear("foxitR_ActivateMainWindow() failed.")
return
}
foxitHotkey_SelectAnnotationMode()
Click
; -- This "Click" makes the commented area "selected"(display in inverted color),
; only then, can foxit_ClickColorProperty() be effective.
; Memo: Before calling foxit_ClickColorPropertyEx(), user should have placed
; mouse cursor onto the commented area and the comment(underline, squiggles etc)
; has benn applied, otherwise, in vain.
; Tested in Foxit Reader 7.1.5 on Win7.
foxit_ClickColorProperty()
}
foxit7_ClickTextColorSelection()
{
; This clicks the Text color selection "button" on the []Format toolbar.
; I have to put this toolbar on a pre-defined location.
;
; When I'm editing the text in a comment text-block, it changes the text color.
ClickInActiveWindow(380, 105)
}
foxit_ClickColorProperty()
{
; This clicks the color-selection "button" inside the Comment-property floating-window.
; This floating window may have title like "Underline Properties", "Squiggly Properties" etc.
is_retried := false
RETRY:
; Click in Color Property button(Property-window pre-open required), so to select a color by keyboard.
; But sometimes the color box does not popup, the workaround is to press space after F12 .
;
; Small flaw: In order for this to work, we should NOT have any opened File property dialogs(from Explorer),
; bcz those dialogs also have title text like "XXX Properties".
titleregex := ".+ (Properties|属性)$"
found := ControlClickClassNN_TitleRegex("Button3", titleregex, 100)
if(found)
{
; wait for the "Properties" dialog to appear
WinWaitActive, % "ahk_class #32770", , 0.2
WinGetTitle, popup_title, A
if(popup_title ~= titleregex)
{
; If current active window title is still "xxx Properties", it means Foxit's color palette
; has not popped up, so we press {space} to have it popup.
Send {space}
}
}
else
{
if(is_retried) {
MsgBox, No window found with regex title:`n`n %titleregex%`n`nYou should have opened Foxit Property Comment Property-window manually.
}
else {
; Try to bring up the "Properties" dialog
is_retried := true
movespeed := 5
MouseGetPos, origx, origy
MouseClick, Right
Sleep, 200
;MouseMove, 10, 10, %movespeed% , R
;Click ; Properties is the first popup menu item (but cannot use hot char there in Foxit 7.1.5)
; Using mouse will fail if the menu is popping out upward(when mouse cursor is near screen bottom).
Send {Down}
Sleep, 500
Send {Enter}
waitmsec := PdfReaderCfg.Foxit7PaletteWaitMillisec
if(not waitmsec)
waitmsec := 300
waitmsec := Max(100, waitmsec)
dev_Sleep(waitmsec) ; wait the palette to popup
goto RETRY
}
}
}
foxit_PixelGetColor_greyscale(x, y)
{
PixelGetColor, rgb, %x%, %y%
; For a red pixel, rgb will be a string: 0x0000FF
r := "0x" . SubStr(rgb, 7, 2)
r += 0 ; note: cannot combine to one line.
g := "0x" . SubStr(rgb, 5, 2)
g += 0
b := "0x" . SubStr(rgb, 3, 2)
b += 0
; MsgBox The color at %x% , %y% position is %rgb% , r=%r%, g=%g%, b=%b% ; debug
; some ref: http://www.joellipman.com/articles/automation/autohotkey/functions-to-convert-hex-2-rgb-and-vice-versa.html
return (r+g+b)/3
}
#If
#If foxit_IsAnnoationPropertyWindowActive()
; [ and ] adjust the Opacity slider .
[:: ClickInActiveControl("msctls_trackbar321", 0.1, 0.5)
]:: ClickInActiveControl("msctls_trackbar321", 0.9, 0.5)
; or using Ctrl+← , Ctrl+→
^Left:: ClickInActiveControl("msctls_trackbar321", 0.1, 0.5)
^Right:: ClickInActiveControl("msctls_trackbar321", 0.9, 0.5)
; or Numpad Home/PgUp
NumpadHome:: ClickInActiveControl("msctls_trackbar321", 0.1, 0.5)
NumpadPgUp:: ClickInActiveControl("msctls_trackbar321", 0.9, 0.5)
#If ; foxit_IsAnnoationPropertyWindowActive()
foxit_GetCommentPropertiesDlgBox()
{
return RegexFindToplevelWindowByTitle(".+ Properties$", "Current Properties as Default")
}
#If foxit_IsWinActive()
foxit_PropertiesClickSlidebar(left_or_right)
{
; Dbgwin_Output(Format("foxit_PropertiesClickSlidebar({})", left_or_right)) ; debug
hwnd := foxit_GetCommentPropertiesDlgBox()
if(hwnd)
{
awinid := dev_GetActiveHwnd() ; this is Foxit main window
dev_ClickInChildClassnn(hwnd, "msctls_trackbar321", left_or_right=="left"?0.1:0.9, 0.5)
/*
dev_WinActivateHwnd(hwnd) ; no use, bcz Comment Properties Dlgbox is *owned* by Foxit main-window.
waitok := dev_WinWaitActiveHwnd(awinid, 500)
if(!waitok)
{
dev_TooltipAutoClear("[Unexpect]Foxit main window is not re-activated.")
}
*/
;Sleep, 1000
Click ; use Click instead
}
}
NumpadHome:: foxit_PropertiesClickSlidebar("left")
NumpadPgUp:: foxit_PropertiesClickSlidebar("right")
#If ; foxit_IsWinActive()
#If foxit_IsWinExist()
; NumpadUp:: foxit_ScrollView("up")
; NumpadDown:: foxit_ScrollView("down")
CapsLock & [:: foxit_ScrollView("up")
CapsLock & ]:: foxit_ScrollView("down")
foxit_ScrollView(sdir)
{
WinGetClass, class, A
if(class=="classFoxitReader")
{
; [2018-01-20] A workaround for a weird symptom:
; If FoxitReader itself is the active windows, RegexBlindScrollAControl will scroll *EmEditor* windows.
; So, for this case, I simply send
Send {%sdir%}
}
else
{
isFoxit7 := RegexBlindScrollAControl(sdir, "ahk_class classFoxitReader", "^AfxWnd100su", "^Reader$")
if(not isFoxit7) {
; tested on Foxit9
RegexBlindScrollAControl(sdir, "ahk_class classFoxitReader", "^FoxitDocWnd1$", "")
}
}
}
#If