when using hotkeys with pyautogui they dont work in any way. i have used to diffrent methods to get it to work. is there any other methods i should try or a fix for the methods im using?
pyautogui.keyDown(ctrl)
pyautogui.keyDown(t)
pyautogui.keyUp(ctrl)
pyautogui.keyUp(t)
NameError: name 'ctrl' is not defined is the error i get here.
pyautogui.hotkey('ctrl , t')
just doesnt work in anyway
can anyone help im trying to automate opening tabs and other things but i cant get it to work.
pyautogui.hotkey()can be unreliable, and there is a much better way to automate opening and closing tabs. Instead, you can usewebbrowserlike this:Unfortunately,
webbrowsercannot close tabs. If you need to close tabs, andpyautogui.hotkey()doesn't work, you can try usingkeyboard: