Hi Uli, I got side-tracked with some other issues and will be taking another look at this on Friday and I will certainly have a good look at the available methods/properties of NSWorkspace, but from memory I don’t think there is a method that returns the currently active application, although I could be wrong. If there were it would be relatively easy to do this.
Cheers Dave > On 18 May 2016, at 03:16, Uli Kusterer <witness.of.teacht...@gmx.net> wrote: > > On 17 May 2016, at 10:34, Dave <d...@looktowindward.com > <mailto:d...@looktowindward.com>> wrote: >>> On 16 May 2016, at 22:17, Jerry Krinock <je...@ieee.org> wrote: >>> >>> Dave, I’ve tried to do stuff similar to this with NSWorkspace, and found it >>> to be often frustrating. According to your initial post, you’ve already >>> tried pretty hard. If lengthening the time delay still does not work good >>> enough for you, then, >>> >>> • If the apps that you want to cycle through are *your* apps, make them >>> talk to one another using some proper interapplication communication. >>> >>> • If the apps that you want to cycle through are *others’* apps, then I >>> agree with Ken that you should reconsider if you really “need” to do this. >> >> They are not my Apps, and I have and I do! I’d have never opened this can of >> worms if I didn’t have to! >> >> I’m really surprised that there doesn’t seem to be a “Application Ready” >> type notification. It struck me that this is a similar problem to >> AppleScript: >> >> tell application “X” >> activate >> end tell >> >> I remember quite a while back that I had problems if I tried to send events >> to the Application too soon after the activate statement, this was usually >> fixed by adding a delay. These days it the above statements seem to work and >> I’m wondering if some code has been added to stop this from happening, and, >> if so if I could do something similar. > > Have you looked into NSWorkspace's NSRunningApplications yet? I think it lets > you check which one is active. > > Cheers, > -- Uli Kusterer > "The Witnesses of TeachText are everywhere..." > http://stacksmith.org <http://stacksmith.org/> _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com