• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to deactivate an app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to deactivate an app


  • Subject: Re: How to deactivate an app
  • From: Leo <email@hidden>
  • Date: Tue, 31 Jan 2012 23:33:38 -0500

If I understand your goals correctly, you can send the following AppleScript script:

tell application "System Events" to set frontmost of process yourApp to true

You can use NSAppleScript of Scripting Bridge (although the latter maybe an overkill for just one line).

Leo


On 1/31/12 2:55:31 AM, Gerriet M. Denkmann wrote:
I have an app A, where I can select a word and press a button.
This starts (or activates) another app called B, which displays some information about this word.

Works fine so far.

But if there is no information about the word, app B should make app A active again.
But how?
(B should not be hidden; it should remain visible, so that the user sees: "Word not found".)

I tried [NSApp deactivate] -  the documentation says, I should not use this method - and indeed, it makes the B-window look inactive, but does NOT make A active - the menu bar still belongs to B.
No good.

The there is NSWorkspace runningApplications - but: "The order of the array is unspecified".
Not really useful.

I just want the equivalent of Command-Tab: making the next most recent app active.

There probably is a simple, direct and obvious solution. But I cannot see it.

Kind regards,

Gerriet.

P.S. 10.7.2


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: How to deactivate an app
      • From: "Gerriet M. Denkmann" <email@hidden>
References: 
 >How to deactivate an app (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: NSDateFormatter, timezones and early dates
  • Next by Date: Re: Block Confusion...
  • Previous by thread: Re: How to deactivate an app
  • Next by thread: Re: How to deactivate an app
  • Index(es):
    • Date
    • Thread