This inspector will not get everything. In order for something to be a “running application” it must first be a registered application, which not all things are.
unique values of names of processes
The most broad thing to do is to look at running processes. This works cross platform and will give back the most stuff. The next thing to do is look at running services, if the thing is a service as well. The final thing is to look for running applications, which will give you the least results but a bit more info for things that are both.
You could also try something like this:
unique values of (names of files of all running services; names of running applications; names of processes)
Or to go even further:
unique values of ( (service name of it | ""; image path of it | ""; display name of it | ""; name of file of it | "") of all running services ; (name of it | ""; name of image file of it | ""; pathname of image file of it | "") of processes ; (task name of it | ""; name of it | ""; pathname of it | "") of running applications )
This should maximize the info available about running items on the system, which you can filter down to what you are looking for using a
whose statement, but having something that returns a TON is a good way to start to see if you can find what you are looking for, then filter down and optimize from there.