import os import time import subprocess # Path to the folder where the photos are saved folder_path = "C:/Your/Photo/Folder" # Get the initial list of files in the folder files_in_folder = os.listdir(folder_path) while True: # Get the current list of files in the folder current_files = os.listdir(folder_path) # Check for new files that were not present in the previous iteration new_files = [file for file in current_files if file not in files_in_folder] if new_files: # New files detected, disable the screen saver subprocess.run(["path_to_command_to_disable_screensaver"]) # Process the new files (e.g., import to Lightroom) # Add your code here # Re-enable the screen saver after processing the new files subprocess.run(["path_to_command_to_enable_screensaver"]) # Update the list of files for the next iteration files_in_folder = current_files # Check every few seconds (adjust the interval as needed) time.sleep(5)