Apple Event keywords

I want a window to pop when a user clicks the icon of the app in the dock. Activate will not do : I want the window to pop when the app is already active and the window is not open.

I have found HandleAppleEvent but need to distinguish when a user clicks on the application icon from other events sent to the app.

The LR is rather limited in the description of AppleEvent properties ; for instance EnumeratedParams which maybe where I can see if it is a click or something else.

aAppleEvent.EnumeratedParam( Keyword as String ) = newStringValue or StringValue = aAppleEvent.EnumeratedParam(Keyword as String) A four character String being passed as a parameter in the AppleEvent.

That’s all :frowning: Is there a place where I can find a list of available keywords ? I have been to Apple developer network but could not find any such list or even reference. The only place where they seem to address that is http://www1.eccn.com/ni/cd/app/7BA5F25A86256A30005B439A.htm but there is no specific mention of mouse events.

I will appreciate any pointer.

Thank you in advance.

Just set a break point in the HandleAppleEvent and check the paramaters. You’ll see that the event is called “rapp”, which stands for
“reopen”.

You’ll find the details here:
Cocoa Scripting Guide

[quote=104979:@Eli Ott]Just set a break point in the HandleAppleEvent and check the paramaters. You’ll see that the event is called “rapp”, which stands for
“reopen”.

You’ll find the details here:
Cocoa Scripting Guide[/quote]

I already found “rapp”. But this event ID is generated the same when the app is launched, when it is told to activate by AppleScript, but also when the icon is clicked. What I want is to find more information about the nature of the event. From reading the different properties of the AppleEvent object, it can contain things like folderitems, pictures, etc. Is not there somewhere another list of keywords than the short one displayed at the link you posted that allows a more precise description of the event ? system.DebugLog theEvent.EnumeratedParam(“rapp”) displays absolutely nothing in this occurrence.

I was hoping to get some additional help over the LR. Now I will try every property and see if I can find some sense.

In Objective-C/Cocoa, I would use applicationShouldHandleReopen:hasVisibleWindows: from NSApplicationDelegate.
“These events are sent whenever the Finder reactivates an already running application because someone double-clicked it again or used the dock to activate it.”
This probably isn’t much help in itself, and I don’t think MacOSLIb implements this, but I mention it in case it leads to further discussion.

https://developer.apple.com/library/mac/documentation/AppleScript/Conceptual/AppleScriptX/AppleScriptX.html
See Apple Events Sent by the Mac OS

Thank you all.