Skip to content

Commit

Permalink
semiautomated screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
GrimReaper2654 committed Aug 23, 2024
1 parent e11b03c commit c764caf
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions imageProcessingArea/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
pillow
fpdf
pytesseract
pyautogui
keyboard
25 changes: 25 additions & 0 deletions imageProcessingArea/screenshotter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import pyautogui
import keyboard

'''
This screenshot progam works on Mac only. You will need to change the keybind if you are using a different OS.
This program needs to control your computer to screenshot so it may need more perms. Sudo should work.
run in terminal at the image processing folder: sudo python3 screenshotter.py
'''

def press_screenshot_keybind():
# Simulate pressing Command + Shift + 5
pyautogui.hotkey('command', 'shift', '5')

def on_c_key():
press_screenshot_keybind()

# Bind the 'c' key to trigger the screenshot keybind
keyboard.add_hotkey('c', on_c_key)

print("Press 'c' to trigger the screenshot keybind (Command + Shift + 5).")
print("Press 'esc' to exit the program.")

# Keep the script running
keyboard.wait('esc')

0 comments on commit c764caf

Please sign in to comment.