Skip to content

Commit 58c0b75

Browse files
2 parents 90e4fb3 + 7d4a8b5 commit 58c0b75

File tree

11 files changed

+242
-19
lines changed

11 files changed

+242
-19
lines changed

BAT-FILES/MANUAL SCHEDULED BACKUP.cmd

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,40 @@
1-
@echo off
1+
@echo on
2+
@REM IMPORTANT-This batch file requires an arguement be passed that is the root folder where your install of BPTV-KB is running from. It is probably best if you just leave it as 'C:\BPTV-KB".
23

3-
REM This will use initool.exe to read the location of the rootFolder from settings.ini
4-
FOR /F "tokens=* USEBACKQ" %%F IN (`..\UTIL-APPS\initool\initool.exe g ..\settings.ini Settings rootFolder --value-only`) DO (
5-
SET rootFolder=%%F
6-
)
74

8-
@REM this command should redirect output of this batch to a log file
9-
> %rootFolder%\BAT-FILES\LOGS\MANUAL_last_run_log.txt (
5+
@echo The current directory is %CD%
6+
@echo and this is what got passed: %1
7+
8+
SET rootFolder=%1
9+
10+
@echo Rootfolder is: %rootFolder%
11+
12+
IF EXIST %rootFolder%\PRIVATE\%computername%\LOGS\manual_last_run_log.txt del %rootFolder%\PRIVATE\%computername%\LOGS\manual_last_run_log.txt
13+
14+
REM this command should redirect output of this batch to a log file
15+
> %rootFolder%\PRIVATE\%computername%\LOGS\manual_last_run_log.txt (
1016

1117
@echo =================================
1218
@echo MANUALLY RUNNING SCHEDULED BACKUP
1319
@echo =================================
1420

1521
@echo Rootfolder is: %rootFolder%
1622

17-
@echo Deleting %rootFolder%\PRIVATE\EDIT2-PC\last_daily_run.txt
23+
@echo Deleting %rootFolder%\PRIVATE\%computername%\last_daily_run.txt
1824
@echo This should allow the backup to be run even if it had already run today.
19-
del %rootFolder%\PRIVATE\EDIT2-PC\last_daily_run.txt
25+
IF EXIST %rootFolder%\PRIVATE\%computername%\last_daily_run.txt del %rootFolder%\PRIVATE\%computername%\last_daily_run.txt
2026

2127
@echo And this will set the date of the %rootFolder%\PRIVATE\%computername%\days_since_system_backup.txt to yesterday
2228
powershell -command "$(Get-Item %rootFolder%\PRIVATE\%computername%\days_since_system_backup.txt).LastWriteTime=(Get-Date).AddHours(-24)"
2329

24-
25-
@REM Set working directory to the location of the SCHEDULED-BATS
26-
@CD %rootFolder%\BAT-FILES\SCHEDULED-BATS
30+
REM Set working directory to the location of the SCHEDULED-BATS
31+
CD %rootFolder%\BAT-FILES\SCHEDULED-BATS
2732

2833
@echo ++ CALLING scheduled-bats.cmd ++
29-
@call %rootFolder%\BAT-FILES\SCHEDULED-BATS\scheduled-bats.cmd
34+
call %rootFolder%\BAT-FILES\SCHEDULED-BATS\scheduled-bats.cmd %rootFolder%
3035
@echo ++ DONE CALLING scheduled-bats.cmd ++
3136

32-
@cd ..
37+
cd ..
3338

3439
@echo ---------------------------------------
3540
@echo MANUAL RUN OF SCHEDLUED BACKUP COMPLETE

BAT-FILES/SCHEDULED-BATS/scheduled-bats.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
@echo off
22

3+
@echo The current directory is %CD%
4+
@echo and this is what got passed: %1
5+
36
@REM This will use initool.exe to read the location of the rootFolder from settings.ini
47
@FOR /F "tokens=* USEBACKQ" %%F IN (`%1\UTIL-APPS\initool\initool.exe g %1\settings.ini Settings rootFolder --value-only`) DO (
58
SET rootFolder=%%F

BAT-FILES/launch_LINTALIST64.cmd

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@echo off
2+
@REM IMPORTANT-This batch file requires an arguement be passed that is the root folder where your install of BPTV-KB is running from. It is probably best if you just leave it as 'C:\BPTV-KB".
3+
4+
@echo The current directory is %CD%
5+
@echo and this is what got passed: %1
6+
7+
@REM This will use initool.exe to read the location of the rootFolder from settings.ini
8+
@FOR /F "tokens=* USEBACKQ" %%F IN (`%1\UTIL-APPS\initool\initool.exe g %1\settings.ini Settings rootFolder --value-only`) DO (
9+
SET rootFolder=%%F
10+
)
11+
12+
@cd %rootFolder%
13+
@echo Now the current directory is %CD%
14+
@REM This command launches LINTALIST64 at the path & location below
15+
@REM This had to be done becuase LINTALIST takes commandline arguments and since we send %A_ScriptDir% to every thing we launch, it was getting confused since that kind of input doesn't mean anything to the app...
16+
17+
start %rootfolder%\PRIVATE\APPS\lintalist64\lintalist.exe

BPTV-CHEAT-SHEETS.ahk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ RemoveSplashScreen:
464464
SetTimer RemoveSplashScreen, Off
465465
return
466466

467-
; use this function to Remove ToolTips - pretty self-explanatory
467+
; use this function to Remove ToolTips - pretty self-explanatory - 'duration' should be given in milliseconds (4000 = 4 seconds)
468468
RemoveToolTip(duration) {
469469
SetTimer, ToolTipOff, %duration%
470470
Return

BPTV-LAUNCHER.ahk

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ sleepDeep := 3500
3232

3333
#Include %A_ScriptDir%\MASTER-FUNCTIONS.ahk
3434

35+
36+
3537
;===== END OF AUTO-EXECUTE =====================================================================
3638

3739
;===== MAIN HOTKEY DEFINITIONS HERE ============================================================
@@ -40,6 +42,8 @@ inifile = settings.ini
4042
INI_Init(inifile)
4143
INI_Load(inifile)
4244

45+
global readSettings_TimeoutPeriod := Settings_timeoutPeriod
46+
4347
; this little section detects if the MASTER-SCRIPT.ahk is already running. That would be a sign that this launcher may have already been run. Since we don't usually want to run this launcher a second time (while the apps it launches are already running) we will set the timeout period to something very high so you have time to interact with the GUI and not have it quickly launch everything over again.
4448
SetTitleMatchMode, 2
4549
DetectHiddenWindows, On
@@ -130,7 +134,7 @@ launcherTimeoutSleep := 1000
130134
loop, %timeoutSegments%
131135
{
132136
GuiControl, , timeoutTextProgress, %timeoutRemaining%
133-
sleep, %launcherTimeoutSleep%
137+
sleep, launcherTimeoutSleep
134138
GuiControl, , timeoutProgress, +1
135139
timeoutRemaining := (timeoutSegments - A_Index)
136140
}
@@ -182,6 +186,11 @@ return
182186
ButtonSaveChanges:
183187
Gui, Submit
184188
;Setting Scripts_loadScriptX to new values
189+
190+
If (Settings_timeoutPeriod != readSettings_TimeoutPeriod) {
191+
Settings_timeoutPeriod := readSettings_TimeoutPeriod
192+
}
193+
185194
currentAltCounter := 1
186195
loop, %section3_keys%
187196
{

MASTER-FUNCTIONS.ahk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ iniFile := A_ScriptDir . "\settings.ini"
3333

3434
;===== FUNCTIONS ===============================================================================
3535

36-
; use this function to Remove ToolTips - pretty self-explanatory
36+
; use this function to Remove ToolTips - pretty self-explanatory - 'duration' should be given in milliseconds (4000 = 4 seconds)
3737
RemoveToolTip(duration) {
3838
SetTimer, ToolTipOff, %duration%
3939
Return

SCRIPTS-AE/AE-HOTKEYS.ahk

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
; AutoHotKey - Buttonpusher Post-Production Keyboard Environment - After Effects HotKeys
2+
; by Ben Howard - [email protected]
3+
4+
;===== START OF AUTO-EXECUTION SECTION =========================================================
5+
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
6+
; #Warn ; Enable warnings to assist with detecting common errors.
7+
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
8+
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
9+
#Persistent ; Keeps script permanently running.
10+
#SingleInstance force ; Ensures that there is only a single instance of this script running.
11+
; SetTitleMatchMode, 2 ; sets title matching to search for "containing" instead of "exact"
12+
#MaxHotkeysPerInterval 2000
13+
#WinActivateForce ;https://autohotkey.com/docs/commands/_WinActivateForce.htm
14+
15+
; The 2 lines below pertain to the 'reload on save' function below (CheckScriptUpdate).
16+
; They are required for it to work.
17+
;FileGetTime ScriptStartModTime, %A_ScriptFullPath%
18+
;SetTimer CheckScriptUpdate, 100, 0x7FFFFFFF ; 100 ms, highest priority
19+
20+
Menu, Tray, Icon, imageres.dll, 251 ; this changes the tray icon to a filmstrip!
21+
;===== INITIALIZATION - VARIABLES ==============================================================
22+
; Sleep shortcuts - use these to standardize sleep times. Change here to change everywhere.
23+
sleepMicro := 15
24+
sleepShort := 333
25+
sleepMedium := 666
26+
sleepLong := 1500
27+
sleepDeep := 3500
28+
29+
splashScreenX = %1%
30+
splashScreenY = %2%
31+
splashScreenTimeout = %3%
32+
33+
#include %A_ScriptDir%\..\LIB\gdip.ahk
34+
;Thanks to tic (Tariq Porter) for his GDI+ Library
35+
;ahkscript.org/boards/viewtopic.php?t=6517
36+
37+
If !pToken := Gdip_Startup() ; this is here just to test that the GDI+ library is available at the path in the above #include
38+
{
39+
MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system
40+
ExitApp
41+
}
42+
OnExit, GdiplusExit
43+
44+
;===== SPLASH SCREEN TO ANNOUNCE WHAT SCRIPT DOES ==============================================
45+
SplashTextOn, 600, 100, Launching %A_ScriptFullPath%, Loading AFTER EFFECTS HOTKEYS Script.
46+
WinMove, Launching %A_ScriptFullPath%, , %splashScreenX%, %splashScreenY%
47+
SetTimer, RemoveSplashScreen, %splashScreenTimeout%
48+
;===== END OF AUTO-EXECUTE =====================================================================
49+
50+
;===== MODIFIER MEMORY HELPER ==================================================================
51+
; combine below with key and '::' to define hotkey
52+
; e.g.- ^f1::Msgbox You pressed Control and F1
53+
; #=Win | !=Alt | ^=Ctrl | +=Shift | &=combine keys | *=ignore other mods
54+
; <=use left mod key| >=use right mod key | UP=fires on release
55+
56+
;===== MAIN HOTKEY DEFINITIONS HERE ============================================================
57+
58+
;===== AFTER EFFECTS HOTKEY DEFINITIONS HERE ============================================
59+
60+
#IfWinActive, ahk_exe AfterFX.exe
61+
62+
F13:: ; <- In Timeline, Select All then collapse/open effects/animated on all tracks
63+
MouseGetPos, xpos, ypos
64+
halfScreenHeight := (A_ScreenHeight / 2)
65+
;MSGBOX, , DEBUG, X: %xpos%`nY:%ypos%`nScreen Height:%A_ScreenHeight%`nhalfScreenHeight:%halfScreenHeight%
66+
If (ypos < halfScreenHeight) {
67+
ToolTip, Make sure to fire this hotkey when Timeline has focus.
68+
RemoveToolTip(3000)
69+
}
70+
71+
Send, {Control Down}a{Control Up}
72+
Sleep, sleepShort
73+
Send, u
74+
Return
75+
76+
77+
#IfWinActive
78+
79+
80+
;===== ILLUSTRATOR HOTKEY DEFINITIONS HERE ============================================
81+
82+
/*
83+
84+
THIS BLOCK IS JUST HERE FOR REFERENCE ON USING 'clickradar()' FUNCTION
85+
86+
#IfWinActive, ahk_exe Illustrator.exe
87+
88+
+^!F6:: ; <-- Clicking on 'Vertical Distribute Center' FOR MIXED OBJECTS
89+
;- why can't this be assigned a key board shortcut in Illustrator?!?
90+
; 'clickRadar' is a function below. You give it the coordinates you want to click & it does the rest.
91+
clickRadar(1056,66)
92+
Return
93+
94+
#IfWinActive
95+
*/
96+
;===== END SCAF DEFINITIONS ===============================================================
97+
98+
;===== FUNCTIONS ===============================================================================
99+
100+
RemoveSplashScreen:
101+
SplashTextOff
102+
SetTimer RemoveSplashScreen, Off
103+
return
104+
105+
106+
107+
; use this function to Remove ToolTips - pretty self-explanatory - 'duration' should be given in milliseconds (4000 = 4 seconds)
108+
RemoveToolTip(duration) {
109+
SetTimer, ToolTipOff, %duration%
110+
Return
111+
112+
ToolTipOff:
113+
ToolTip
114+
return
115+
}
116+
117+
; This function will auto-reload the script on save.
118+
CheckScriptUpdate() {
119+
global ScriptStartModTime
120+
FileGetTime curModTime, %A_ScriptFullPath%
121+
If (curModTime <> ScriptStartModTime) {
122+
Loop
123+
{
124+
reload
125+
Sleep 300 ; ms
126+
MsgBox 0x2, %A_ScriptName%, Reload failed. ; 0x2 = Abort/Retry/Ignore
127+
IfMsgBox Abort
128+
ExitApp
129+
IfMsgBox Ignore
130+
break
131+
} ; loops reload on "Retry"
132+
}
133+
}
134+
135+
; clickRadar is used to show a yellow-circle.png centered on the coords you send the function. The idea is that they should be centered on the coords you will be clicking on.
136+
; to get the transparency working, we need to use the GDI+ library
137+
; Based on the tutorial here: https://github.com/tariqporter/Gdip/blob/master/Gdip.Tutorial.3-Create.Gui.From.Image.ahk
138+
clickRadar(sx,sy){
139+
global sleepShort
140+
; we are going to store the position of your cursor when you show this so that we can put the cursor back where it was
141+
;coordmode, mouse, Screen
142+
MouseGetPos, xposP, yposP
143+
offsetSX := (sx - 25)
144+
offsetSY := (sy - 25)
145+
;MSgBox, Sent: %sx%, %sy%`nOffset: %offsetSX%, %offsetSY%`nGrabbed: %xposP%, %yposP%
146+
; this is all blackmagic provided by GDI+
147+
Gui, ShowPicture: -Caption +E0x80000 +LastFound +OwnDialogs +Owner +hwndhwnd +alwaysontop
148+
Gui, ShowPicture: Show, NA ,dialog
149+
150+
pBitmap:=Gdip_CreateBitmapFromFile("yellow-circle.png")
151+
Gdip_GetImageDimensions(pBitmap,w,h)
152+
153+
hbm := CreateDIBSection(w,h)
154+
hdc := CreateCompatibleDC()
155+
obm := SelectObject(hdc, hbm)
156+
pGraphics:=Gdip_GraphicsFromHDC(hdc)
157+
158+
Gdip_DrawImage(pGraphics, pBitmap, 0,0,w,h)
159+
UpdateLayeredWindow(hwnd, hdc,offsetSX,offsetSY,w,h)
160+
Gdip_DisposeImage(pBitmap)
161+
sleep, sleepShort
162+
destroyGDIplusGUI()
163+
Click, %sx%, %sy%
164+
MouseMove, xposP, yposP, 0 ; returning cursor where it was
165+
return
166+
}
167+
168+
destroyGDIplusGUI(){ ; this should not only kill the ShowPicture but free up everything it used and reset things for the next time a CheatSheet is shown (we want showPicture to be set to 0)
169+
; Now the bitmap may be deleted
170+
DeleteObject(hbm)
171+
172+
; Also the device context related to the bitmap may be deleted
173+
DeleteDC(hdc)
174+
175+
; The graphics may now be deleted
176+
Gdip_DeleteGraphics(G)
177+
178+
; The bitmap we made from the image may be deleted
179+
Gdip_DisposeImage(pBitmap)
180+
showPicture = 0
181+
Gui, ShowPicture:Destroy
182+
Return
183+
}
184+
185+
GdiplusExit:
186+
; gdi+ may now be shutdown on exiting the program
187+
Gdip_Shutdown(pToken)
188+
ExitApp

SCRIPTS-AE/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Scripts and elements for Adobe Illustrator scripting

SCRIPTS-AE/yellow-circle.png

476 Bytes
Loading

SCRIPTS-PPRO/PREMIERE-PRO-HOTKEYS.ahk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ RemoveSplashScreen:
352352
SetTimer RemoveSplashScreen, Off
353353
return
354354

355-
; use this function to Remove ToolTips - pretty self-explanatory
355+
; use this function to Remove ToolTips - pretty self-explanatory - 'duration' should be given in milliseconds (4000 = 4 seconds)
356356
RemoveToolTip(duration) {
357357
SetTimer, ToolTipOff, %duration%
358358
Return

0 commit comments

Comments
 (0)