I have a workflow where I want to provide a list of applications so that an application can be selected and the workflow continue. I want a list of the current running applications so I'm using a Script Filter. My question is how can I load the icon of the app to show it in the list rather than the icon of the workflow? I can't seem to find out how to programmatically load it.
Here is the AppleScript I'm using with the Script Filter:
on run argv
tell application "System
You don’t need the on run. You’ll also need to make sure you’re using POSIX paths. Try this:
tell application "System Events"
set runningProcesses to (every process whose background only is false)
end tell
set alfredJSON to "{\"items\": ["
repeat with runningProcess in runningProcesses
set appName to name of runningProcess
set appPath to POSIX path of (file of runningProcess as alias)
set alfredJSON to alfredJSON & "{\"uid\": \"" & appName & "\",
\"type\": \"default\", \"ti