So I have this code working just to make sure that my Event Listeners are now working:
#targetengine "MyEngine"
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
function doThis()
{
alert("here");
}
app.addEventListener("afterSelectionChanged",doThis);
After my selection changes I do indeed get an alert. SO,
I'm using http://jongware.mit.edu/idcs5/pc_Library.html as an API and after doing some research it seems that there are no eventTypes that are suitable at the Application and document level for what I am trying to do. And there are No event types listed for a Library or an Asset. Are you seeing something I'm not?
APLICATION:
| AFTER_ACTIVATE | string | readonly | Dispatched after the Application becomes active. This event bubbles. This event is not cancelable. (default: afterActivate) |
| AFTER_CLOSE | string | readonly | Dispatched after a Document is closed. This event bubbles. This event is not cancelable. (default: afterClose) |
| AFTER_CONTEXT_CHANGED | string | readonly | Dispatched after the active context changes. This event bubbles. This event is not cancelable. (default: afterContextChanged) |
| AFTER_QUIT | string | readonly | Dispatched when the Application is quitting. Since the quit has been committed, it can not be canceled. This event bubbles. This event is not cancelable. (default: afterQuit) |
| AFTER_SELECTION_ATTRIBUTE_CHANGED | string | readonly | Dispatched after an attribute on the active selection changes. This event bubbles. This event is not cancelable. (default: afterSelectionAttributeChanged) |
| AFTER_SELECTION_CHANGED | string | readonly | Dispatched after the active selection changes. This event bubbles. This event is not cancelable. (default: afterSelectionChanged) |
| BEFORE_DEACTIVATE | string | readonly | Dispatched before the Application becomes inactive. This event bubbles. This event is not cancelable. (default: beforeDeactivate) |
| BEFORE_NEW | string | readonly | Dispatched before a Document is created. This event bubbles. This event is cancelable. (default: beforeNew) |
| BEFORE_OPEN | string | readonly | Dispatched before a Document is opened. This event bubbles. This event is cancelable. (default: beforeOpen) |
| BEFORE_QUIT |
|
|
DOCUMENT:
| Property | Type | Access | Description |
|---|
| AFTER_ACTIVATE | string | readonly | Dispatched after the Document becomes active. This event bubbles. This event is not cancelable. (default: afterActivate) |
| AFTER_EXPORT | string | readonly | Dispatched after a Document is exported. This event bubbles. This event is not cancelable. (default: afterExport) |
| AFTER_IMPORT | string | readonly | Dispatched after importing a file into a Document. This event bubbles. This event is not cancelable. (default: afterImport) |
| AFTER_LINKS_CHANGED | string | readonly | Dispatched after one or more links in the Document have been added, deleted, or modified. This event bubbles. This event is not cancelable. (default: afterLinksChanged) |
| AFTER_NEW | string | readonly | Dispatched after a Document is created. This event bubbles. This event is not cancelable. (default: afterNew) |
| AFTER_OPEN | string | readonly | Dispatched after a Document is opened. This event bubbles. This event is not cancelable. (default: afterOpen) |
| AFTER_PRINT | string | readonly | Dispatched after a Document is printed. This event bubbles. This event is not cancelable. (default: afterPrint) |
| AFTER_REVERT | string | readonly | Dispatched after a Document is reverted. This event bubbles. This event is not cancelable. (default: afterRevert) |
| AFTER_SAVE | string | readonly | Dispatched after a Document is saved. This event bubbles. This event is not cancelable. (default: afterSave) |
| AFTER_SAVE_AS | string | readonly | Dispatched after a Document is saved under a new name. This event bubbles. This event is not cancelable. (default: afterSaveAs) |
| AFTER_SAVE_A_COPY | string | readonly | Dispatched after a copy of a Document is saved. This event bubbles. This event is not cancelable. (default: afterSaveACopy) |
| BEFORE_CLOSE | string | readonly | Dispatched before a Document is closed. This event bubbles. This event is not cancelable. (default: beforeClose) |
| BEFORE_DEACTIVATE | string | readonly | Dispatched before the Document becomes inactive. This event bubbles. This event is not cancelable. (default: beforeDeactivate) |
| BEFORE_EXPORT | string | readonly | Dispatched before a Document is exported. This event bubbles. This event is cancelable. (default: beforeExport) |
| BEFORE_IMPORT | string | readonly | Dispatched before importing a file into a Document. This event bubbles. This event is cancelable. (default: beforeImport) |
| BEFORE_PRINT | string | readonly | Dispatched before a Document is printed. This event bubbles. This event is cancelable. (default: beforePrint) |
| BEFORE_REVERT | string | readonly | Dispatched before a Document is reverted. This event bubbles. This event is cancelable. (default: beforeRevert) |
| BEFORE_SAVE | string | readonly | Dispatched before a Document is saved. This event bubbles. This event is cancelable. (default: beforeSave) |
| BEFORE_SAVE_AS | string | readonly | Dispatched before a Document is saved under a new name. This event bubbles. This event is cancelable. (default: beforeSaveAs) |
| BEFORE_SAVE_A_COPY | string | readonly | Dispatched before a copy of a Document is saved. This event bubbles. This event is cancelable. (default: beforeSaveACopy) |
| FAILED_EXPORT | string | readonly | Dispatched after a Document export is canceled or fails. This event bubbles. This event is not cancelable. (default: failedExport) |
There's an extension included in the CS SDK which gives great feedback on what events are triggered when -- and on which objects.
You can thank Bob Stucky (the author of the extension) for the suggestion to post it here.
Here's an installable version of the extension:
http://in-tools.com/downloads/asst/EventWatcher.zxp
And here's a couple of screenshots:

