Re: How to deactivate an app

2012-02-02 Thread Gerriet M. Denkmann
On 2 Feb 2012, at 00:51, Leo wrote: What happens if you send set frontmost of process yourApp to false then, using the name of your app? Will it reveal the previous app by a chance? It seems that process has to be followed by a number. I tried this in AppleScript Editor: tell

Re: How to deactivate an app

2012-02-01 Thread Gerriet M. Denkmann
On 1 Feb 2012, at 14:29, Ken Thomases wrote: On Feb 1, 2012, at 1:20 AM, Gerriet M. Denkmann wrote: I tried: - (void)applicationWillBecomeActive:(NSNotification *)aNotification { (void)aNotification; NSRunningApplication *currentApplication = [ NSRunningApplication

Re: How to deactivate an app

2012-02-01 Thread Leo
What happens if you send set frontmost of process yourApp to false then, using the name of your app? Will it reveal the previous app by a chance? If not, then is there any way to capture the name of the app you need to activate at an earlier stage, so you can send it set frontmost to true

Re: How to deactivate an app

2012-02-01 Thread Lee Ann Rucker
On Jan 31, 2012, at 11:29 PM, Ken Thomases wrote: On Feb 1, 2012, at 1:20 AM, Gerriet M. Denkmann wrote: Although the name of the notification is applicationWillBecomeActive it acts more like applicationIsAlreadySomehowActiveAndWIllBecomeFullyActiveRealSoonNow. Well, remember that

How to deactivate an app

2012-01-31 Thread Gerriet M. Denkmann
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

Re: How to deactivate an app

2012-01-31 Thread Lee Ann Rucker
produces a very bad user experience., but this seems like a valid exception - you're returning focus to where it was. - Original Message - From: Gerriet M. Denkmann gerr...@mdenkmann.de To: cocoa-dev@lists.apple.com Sent: Monday, January 30, 2012 11:55:31 PM Subject: How to deactivate

Re: How to deactivate an app

2012-01-31 Thread Ken Thomases
On Jan 31, 2012, at 1:55 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. But if there is no information about the word, app B should make app A

Re: How to deactivate an app

2012-01-31 Thread Gerriet M. Denkmann
On 31 Jan 2012, at 17:18, Ken Thomases wrote: On Jan 31, 2012, at 1:55 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. But if there is no

Re: How to deactivate an app

2012-01-31 Thread Lee Ann Rucker
...@mdenkmann.de To: Ken Thomases k...@codeweavers.com Cc: cocoa-dev@lists.apple.com Sent: Tuesday, January 31, 2012 10:40:11 AM Subject: Re: How to deactivate an app On 31 Jan 2012, at 17:18, Ken Thomases wrote: On Jan 31, 2012, at 1:55 AM, Gerriet M. Denkmann wrote: I have an app A, where I

Re: How to deactivate an app

2012-01-31 Thread Leo
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

Re: How to deactivate an app

2012-01-31 Thread Gerriet M. Denkmann
On 1 Feb 2012, at 11:33, Leo wrote: 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 I tried the following in AppleScript Editor: set appList to processes tell application

Re: How to deactivate an app

2012-01-31 Thread Gerriet M. Denkmann
On 1 Feb 2012, at 04:43, Lee Ann Rucker wrote: I was afraid you were going to say Services :) When I'm using this both apps are under my control. Haven't tried this, but you could try checking which app is active in applicationWillBecomeActive: and restore that when you're done. I

Re: How to deactivate an app

2012-01-31 Thread Ken Thomases
On Feb 1, 2012, at 1:20 AM, Gerriet M. Denkmann wrote: I tried: - (void)applicationWillBecomeActive:(NSNotification *)aNotification { (void)aNotification; NSRunningApplication *currentApplication = [ NSRunningApplication currentApplication ]; NSString