It worked as follows - I'd have Firefox open but in background, so I need the script NOT to open a new instance but to simply return to the page I was on and complete the rest of the code.
In AUTOKEY I had:
Code: Select all
# Do prelim vars here, I'm fine with this part
#start firefox or switch to firefox
import subprocess
command = 'wmctrl -l'
output = system.exec_command(command, getOutput=True)
if 'Firefox' in output:
window.activate('Firefox',switchDesktop=True)
else:
subprocess.Popen(["/usr/bin/firefox"])
#
time.sleep(0.3)
mouse.click_absolute(544, 519, 1)
# Finish edits here, this is all good
I just need the correct code to duplicate what the old code did? If there's someone kind enough to help, please.