So i've done this program that helps me to manage windows and applications that i wanna have opened after i log in , and i realized that if i put this script to startup folder it'll start the program before i even login, and that's not what i want because the program depends on the time between starting application and pressing keyboard shortcut.I need the program to start after i login.I'm using pycharm with python 3.8 . This is the code i wanna run after i Login.
import os
import time
import pyautogui
os.startfile("C:\\Program Files\\JetBrains\\PyCharm Community Edition
2019.3.2\\bin\\pycharm64.exe")
time.sleep(2)
os.startfile('C:\\Users\\Igor\\AppData\\Local\\Programs\\Opera\\launcher.exe')
time.sleep(25)
pyautogui.keyDown('ctrl')
time.sleep(0.2)
pyautogui.keyDown('win')
time.sleep(0.2)
pyautogui.keyDown('down')
time.sleep(0.5)
pyautogui.keyUp('ctrl')
time.sleep(0.1)
pyautogui.keyUp('win')
time.sleep(0.1)
pyautogui.keyUp('down')
pyautogui.press('enter')
I've already looked up the same question on stack-overflow but there was no exact answer.