-
Notifications
You must be signed in to change notification settings - Fork 0
/
TimedCapture.py
39 lines (25 loc) · 938 Bytes
/
TimedCapture.py
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
#! python
# Script By JB
# Written to Auto ShutOff capture in BlackMagic Express - aka Limit Capture in FCP
# Open Terminal - 'python script ##<minutes>' - start
# start capture, uses screenshot to finish
import time
import pyautogui
#Enter time.
ttr_minutes = pyautogui.prompt('Enter Total Run Time in Minutes. Only use whole numbers.')
#Convert to Seconds
ttr_seconds = int(ttr_minutes)*60
# Start clock
for t in range(ttr_seconds,-1,-1):
minutes = t / 60
seconds = t % 60
print "%d:%2d" % (minutes,seconds) # Python v2 only
time.sleep(1.0)
#SCREESHOTS - find and click - end capture OR Grab window and hit 'ESC" key to end.
#!! pyautogui.press('esc')
button_location = pyautogui.locateOnScreen('capture.png')
bx, by = pyautogui.center(button_location)
pyautogui.click(bx, by) # Click Button
# ALERT
pyautogui.alert('Your Capture has finished.')
print('DONE! - Click - <Your Capture has finished> Window')