I am trying to create script or some code template to rerun main.py server for some reasons. Is it possible to do using Shell or some Python code? I tried this Shell script: #!/bin/bash osascript <<EOF tell application "PyCharm" to activate delay 1 # Give it a moment to fully focus tell application "System Events" keystroke "r" using control down end tell EOF But it not work as expected, it sometimes runs inside terminal, or run smth weird. Continue reading...