I am using SwiftUI for MAC App. I am working on the track feature to get the active app on screen from the background. I have implemented the solution below but am unable to get it.
let workspace = NSWorkspace.shared
let applications = workspace.runningApplications
for application in applications {
if let url = (application.executableURL?.absoluteString) {
os_log("%{public}s", log:scribe, type:.debug, url)
}
}
}
Or Is it possible to get?