I\'m very new to a cocoa programming and I can\'t find the way to do the following:
For Swift2 version
Launch App:
let task = NSTask()
task.launchPath = "/usr/bin/env"
task.arguments = ["/Applications/TextEdit.app/Contents/MacOS/TextEdit"]
task.launch()
To get the app using bundle Identifier:
var apps: [AnyObject] = NSRunningApplication.runningApplicationsWithBundleIdentifier("com.apple.TextEdit")
var MyApp: [NSRunningApplication] = apps as! [NSRunningApplication]
for app in MyApp
{
}
I am still trying to find the way to know "active", "hide" etc state of app, But not succeed till now.