AppleScript for Running Apps

@peternlewis, as I understand it, you use AppleScript to implement many of the Keyboard Maestro elements. If so, would you mind sharing the AppleScript for Running Applications collection.

It runs very fast.

Here's my test macro for those that might be interested:

###Example Results

###MACRO:   @App Get List of Running Apps @TEST

~~~ VER: 1.0    2017-05-30 ~~~

####DOWNLOAD:
@App Get List of Running Apps @TEST.kmmacros (4.3 KB)
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.


AppleScript is used for interacting with some applications (eg, controlling Safari, Chrome or iTunes).

It is not used for anything related to running applications I don’t believe.

OK, thanks.

I think I’ve found a solution:

tell application "System Events"
  set runningAppList to (every process where background only is false)
end

Compares well with the KM List, and is also very fast.

This script will generate the actual App Name List:

##example Results

Finder
TextExpander
SnippetsLab
Evernote
Microsoft Outlook
LaunchBar
Keyboard Maestro
Google Chrome
Quiver
Script Editor
BBEdit
Script Debugger

##applescript

tell application "System Events"
	set appNameList to (name of every process where background only is false)
end tell

set AppleScript's text item delimiters to linefeed
return appNameList as text