0

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.

Skalex
  • 136
  • 2
  • 10
  • What OS? Are you using any framework or just vanilla Python? – pasbi Jan 06 '20 at 13:24
  • just vanilla python on windows but I am trying to find a good module to do this. I found one module called wmi that lists all open programs but its very slow and has almost no documentation on how to use it. – Skalex Jan 07 '20 at 22:18
  • 1
    Does this answer your question? [List running processes on 64-bit Windows](https://stackoverflow.com/questions/1632234/list-running-processes-on-64-bit-windows) – pasbi Jan 07 '20 at 22:40
  • Yes it did thank you – Skalex Apr 05 '20 at 22:14

0 Answers0