Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8041401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:12:24+00:00 2026-06-05T04:12:24+00:00

I want to make my application as menu bar app and I made it

  • 0

I want to make my application as menu bar app and I made it already.
And also I want to track what application is running.

NSRunningApplication method returns all runnng applications.
But I want to detect the only application that is activated now. (with mouse click or command + tab…)
How can I find that?

I made code below :

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
     [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(performTimerBasedUpdate) userInfo:nil repeats:YES];
}

- (void)performTimerBasedUpdate {
     nowRunning = [NSRunningApplication currentApplication];
     nowRunningName = [nowRunning localizedName];
}

But, It returns the application name that I made (self).

  • Answered

I finally find the answer : thank you i-blis.
I can get the activated application with filter.
I didn’t know about isActive property!

runningApplications_ = [[NSWorkspace sharedWorkspace] runningApplications];
nowRunning = [[runningApplications_ filteredArrayUsingPredicate:isActive] objectAtIndex:0];
bundleIdentifier_ = [nowRunning bundleIdentifier];
localizedName = [nowRunning localizedName];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T04:12:25+00:00Added an answer on June 5, 2026 at 4:12 am

    You can easily find if an application is active with isActive. Then peek the localizedName or bundleIdentifier at your will. I am not really fluent in Objective-C but with Macruby syntax you’ll get it in the following way :

    NSWorkspace.sharedWorkspace.runningApplications
        .select { |e| e.isActive == true }
        .map { |e| e.localizedName }
    

    You may need to filter out your own application: I did not test how menu bar apps are handled in this regard.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make my application similar to mail.app in vertical orientation. It should
Hi I want to make such kind of menu for my iPhone/iPad Application but
I want make interactive application where user launches it and can do various task
I want to make an application that would display a message when a user
I want to make an Application that uses RxTx version 2.2pre2 to work with
I want to make an application witch involves logging into google. It is basically
I want to make an application in C or C++ which have to monitor
I want to make an application that shows a frame by frame animation when
Okay so I want to make an application that launches other applications. However, the
I want to make an console application of c which can run other applications

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.