When I run the following code from terminal the pop-up box will become frontmost but with KM it will not. I get no error message, it's just that the window will not become frontmost.
Don't worry about this code:
timerbox('hey','countdown', time=1)
This is the code that is not working but there is no error message:
os.system(f'''/usr/bin/osascript -e 'tell app "Finder" to set frontmost of process "Python" to true' ''')