this python script should do the job on windows:
import pyautogui
import keyboard
import time
# Pause for a few seconds to give you time to switch to the window you want to automate
time.sleep(10)
print("10sec")
while True:
pyautogui.press('enter')
print("Pressed Enter key")
time.sleep(1)
pyautogui.hotkey('ctrl', 'a')
print("Pressed Ctrl+A keys")
pyautogui.hotkey('ctrl', 'x')
print("Pressed Ctrl+X keys")
pyautogui.press('backspace')
print("Pressed Backspace key")
time.sleep(3)
pyautogui.hotkey('ctrl', 'v')
print("Pressed Ctrl+V keys")
pyautogui.press('delete')
print("Pressed Delete key")
time.sleep(1)
pyautogui.press('enter')
print("Pressed Enter key")
time.sleep(1)
pyautogui.press('right')
print("Pressed Right Arrow key")
pyautogui.press('left')
print("Pressed Left Arrow key")
# Listen for the Esc key press and stop the script if detected
if keyboard.is_pressed('Esc'):
break
note: it also deletes the subfolder