Questions tagged [nsrunningapplication]
44 questions
2
votes
2 answers
Objective-C: Refreshing FrontmostApplication
I wrote this little program which is supposed to print the current frontmost application twice, with a 3-second break in between.
void printFrontmostApp() {
NSRunningApplication *frontmostApplication = [NSWorkspace…

user5498580
- 45
- 4
2
votes
1 answer
Notification of active document change on OS X?
I'm using NSWorkspace's NSWorkspaceDidActivateApplicationNotification to detect when the active application changes. I get NSRunningApplication from the userInfo key of the notification.
I need to get a notification when the active document…

Luke
- 13,678
- 7
- 45
- 79
1
vote
2 answers
NSRunningApplication can't recognize PID of Window Server?
In my Cocoa app I am detecting visible windows and getting PID of their owners. Then for ever PID I create NSRunningApplication object (using runningApplicationWithProcessIdentifier:) to get additional info (localized name, path, attributes…

PhoenixS
- 1,016
- 1
- 9
- 23
1
vote
1 answer
In a sandboxed macOS application, is it possible to terminate other applications programmatically?
I am writing a sandboxed macOS application in Objective-C / Swift. I am interested in terminating other applications programmatically. In Cocoa, there is a NSRunningApplication class that exposes the following methods:
- (BOOL)terminate;
-…

Alfonso Tesauro
- 1,730
- 13
- 21
1
vote
1 answer
In a macOS Objective-C application, I have subclassed NSMutableSet for enforcing an equality different from isEqual. Is my implementation fine?
In my macOS Objective-C application, I have created a subclass of NSMutableSet. What I want to achieve is a NSMutableSet that does not use isEqual: as the comparing strategy. Specifically, The set will contain objects of type NSRunningApplication,…

Alfonso Tesauro
- 1,730
- 13
- 21
1
vote
1 answer
More accurate identification of running applications on Mac OS
By using runningApplications of NSWorkspace, it is possible to get a list of running apps on Mac OS as NSRunningApplication objects, and from this get additional information like what application is in the foreground.
It is possible to identify the…

Locksleyu
- 5,192
- 8
- 52
- 77
1
vote
0 answers
Fetch Process Name With runningApplicationWithProcessIdentifier: and OSXFuse
I am using OSXFuse and get the processID of the application that wants to read a file in the FUSE Filesystem on Mac. Using the OSXFuse [GMUserFileSystem currentContext], we fetch the process ID and now I would like to get the application name from…

Anish
- 390
- 5
- 16
1
vote
2 answers
NSWorkspace sharedWorkspace runningApplications causing memory leak; alternative option?
I'd like to know whether anyone has a suggestion for an alternative to using runningApplications, as something like the following appears to be leaking…

William Gustafson
- 526
- 2
- 13
1
vote
1 answer
-[NSRunningApplication activateWithOptions:] not working
I'm trying to create a program that will focus a certain application (if it is launched). Here is my code:
#import
#import
int main() {
// activate Firefox
NSArray *apps = [NSRunningApplication…

Adrian
- 14,931
- 9
- 45
- 70
1
vote
0 answers
Finder not responding to [NSRunningApplication activateWithOptions] on secondary display
I’m trying to bring the Finder window to front:
NSRunningApplication *finder = [NSRunningApplication runningApplicationWithProcessIdentifier:finderPID];
[finder activateWithOptions:NSApplicationActivateIgnoringOtherApps];
This works on the primary,…

zoul
- 102,279
- 44
- 260
- 354
1
vote
1 answer
Unkillable, bogus NSRunningApplication sitting in my Dock?
I'm using Xcode 5.1.1 on OSX 10.9.4 to debug a Cocoa + OpenGL application. So far I've only ever run my app under the Xcode debugger. Last week I exited Xcode only to find an icon for my app still sitting in the Dock. Using Show In Finder led me to…

Belden Fox
- 1,257
- 1
- 8
- 6
1
vote
1 answer
Can I get the actual Menu Bar from an NSRunningApplication?
I'm trying to access the menu of an NSRunningApplication object in OS X. it has an ownsMenuBar @property, however no instance of an actual menu bar (which makes sense). I'm curious, instead, how to get access to that menu-bar that…

iiian
- 393
- 1
- 5
- 17
1
vote
2 answers
Running iOS app on the simulator using Jenkins
I'm setting up my CI server with Jenkins. I can successfully build the app but now I need a way to run it in the simulator. How can I do it?

Claus
- 5,662
- 10
- 77
- 118
1
vote
0 answers
Retrieve information about Single Windows of an Running Application in NSRunningApplication
Im writing an iPad app that should be able to manipuliate single windows of an mac applications eg. close them, minimize them, et cetera. I got all the network stuff working but im having trouble with retrieving information from my mac.
I can get…

DamirDiz
- 701
- 2
- 10
- 15
1
vote
1 answer
Obtaining applications enlisted in force quit window
I am trying to retrieve all applications which are enlisted in force quit window.
When I am using runningAppications method using below line of code:
[[NSWorkspace sharedWorkspace] runningApplications];
It is enlisting many extra applications which…

Devarshi
- 16,440
- 13
- 72
- 125