I would like to know if there is a way to get the list of applications similar to the list of Force Quit Applications

I do not know that what I have written so far will allow me to receive such information.
extension ViewController: NSTableViewDelegate {
fileprivate enum CellIdentifiers {
static let NameCell = "cell"
}
func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? {
var appName: String = ""
var appIcon: NSImage?
appName = applications[row].localizedName!
appIcon = applications[row].icon
if let cell = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "applicationCell"), owner: nil) as? NSTableCellView {
cell.textField?.stringValue = appName
cell.imageView?.image = appIcon ?? nil
print("created")
return cell
}
return nil
}
When I debug, I get all the processes, but I only want to get a list of applications. This is an example of the results I get:

We see that there are applications, but also all processes (which I do not want to have).
source
share