This requires System Events beta to work: It returns a list of running “User” processes in 10.2 and up. This will leave out all of the “background” system processes. From the AppleScript Users List.
OS version: OS X
tell application "System Events"
tell process "Dock" to set dockStuff to title of every UI element
set runningApps to {}
set procs to the title of application processes
repeat with curApp in dockStuff
if curApp is in procs then
set runningApps to runningApps & curApp
end if
end repeat
end tell
Nice, but this script will find apps that are running yet hidden from the dock:
tell application "System Events"
set applist to {}
set apps to get application processes
repeat with a in apps
if not background only of a then
set end of applist to (displayed name of a)
end if
end repeat
applist
end tell
Model: PowerMac 2 x G5 2.5ghz
AppleScript: 1.10.3
Browser: Safari 416.12
Operating System: Mac OS X (10.4)
And the fact that no one else mentioned 10.4 specifically when posting other code. But, I’ve now tested it on a 10.4 machine and all of them compile. Excellent.
Running on 10.3.9 it doesn’t recognize Adobe Illustrator 10.0.3
The title of Illustrator’s application process (Illustrator) is different than its name on the Dock (Adobe Illustrator 10).
The other code snips run as expected on 10.4.2, listing apps correctly.