Currently, I am trying to make a personal assistant and one of its current features is to open apps such as saying 'open Spotify'. However, the user must first say what the path is to that app which is slow and tedious currently. Instead, I want my program to prompt the user if they want to create a shortcut to an app they have never seen before simply by opening an app.
Here's an example of what I think the code would look like
savedAppDirs = {}
def CheckApps():
#get a list of the opened app's directories
openAppDirs = GetOpenApps() #this is what i don't know what to do
for openDir in openAppDirs:
if not openDir in list(savedAppDirs.values()):
if "y" == input("You've opened an app i haven't seen before. Would you like to create a shortcut to make it easier?(y/n) ").lower():
savedAppDirs[input("Enter a name for this shortcut: ")] = openDir
The only issue is I don't know how I can find out what apps the user has open. Thanks for any help on this.