-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstantKeyframe.ahk
66 lines (55 loc) · 2.07 KB
/
instantKeyframe.ahk
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
;--------------------------------------------
; This script is meant to just create a new keyframe exactly where the current time scrub is at.
;--------------------------------------------
SetWorkingDir, C:\AHK\AutoAfterEffects\img
; Sets the reference directory for your image files.
#NoEnv
;Menu, Tray, Icon, shell32.dll, 283 ; this changes the tray icon to a little keyboard!
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input
#SingleInstance force ;only one instance of this script may run at a time!
#MaxHotkeysPerInterval 2000
#WinActivateForce ;https://autohotkey.com/docs/commands/_WinActivateForce.htm
; The following line checks to make sure the active window is Adobe After Effects, this avoids causing key conflict
#IfWinActive ahk_exe AfterFX.exe
F4::nkf(1)
nkf(open := 1)
{
BlockInput, on
BlockInput, MouseMove
CoordMode Pixel, window
CoordMode Mouse, window
MouseGetPos xPos, yPos
rightedge = 200 ;250 for 150% UI
expanseUp = 13 ;32 for 150% UI
expanseDown = 13 ;10 for 150% UI
CoordMode Pixel, window
CoordMode Mouse, window
If open = 1
{
ImageSearch, FoundX, FoundY, 0, yPos-expanseUp, rightedge, yPos+expanseDown, %A_WorkingDir%\iv_nkframe1.png
if ErrorLevel = 1 ;if that was unable to find it, try again with another image
ImageSearch, FoundX, FoundY, 0, yPos-expanseUp, rightedge, yPos+expanseDown, *2 %A_WorkingDir%\iv_nkframe2.png
if ErrorLevel = 1 ;if that was unable to find it, try again with another image
ImageSearch, FoundX, FoundY, 0, yPos-expanseUp, rightedge, yPos+expanseDown, *2 %A_WorkingDir%\iv_nkframe3.png
if ErrorLevel = 0
{
;tooltip, The icon was found at %FoundX%x%FoundY%.
;msgbox, The icon was found at %FoundX%x%FoundY%.
MouseMove, FoundX+16, FoundY+8, 0
sleep 5
click left
sleep 5
goto resetloop
}
}
tooltip, FAIL`, ErrorLevel is %ErrorLevel%
;msgbox, , , num enter, 0.5;msgbox, , , num enter, 0.5
resetloop:
;;MouseMove, xPos-8, yPos-8, 0
MouseMove, xPos+0, yPos+0, 0
blockinput, off
blockinput, MouseMoveOff
sleep 20
tooltip,
}