sorry, but no great news...
regarding time change command notifications,
i don't know if there's such an event, because the commands are not listed anywhere. (you have to contact adobe and ask)
but you can experiment and see!
use AEGP_RegisterCommandHook with AEGP_Command_ALL, and see if you get calls during time changes.
(it's might take some time to filter out other calls...)
as for telling what timeline is active...
i don't know of a direct way.
otherwise... i honestly don't know.
Trivia: Not even AE can do everything when you are in a different timeline from what you see. For example, you can't right click and choose easy ease etc.
Thanks a lot anyway!
Sorry, a couple of more questions. First of all, do we know anything about command numbers? Such as the range(s) they are in? I know I can ask the API guys for this but I would like to experiment a little on my own first.
Secondly: Is it possible to put an AEGP command in the Layer -> New submenu, below the standard layer types? Actually I'm mostly interested in the popup you get when you right click the timeline, and choose New.
command numbers start from 1, and end... i don't know where.
i saw commands with a number as high as 5000. so we're probably talking thousands and not millions.
as for the sub menu, if it's not listed as an AEGP_MenuID, then i'm guessing that you can't put it there.
you can with a lot (really a lot) of effort get hold of the main window handle for AE, and add items directly to it (a friend of mine did that a while ago), but i'm not sure how you could track down the "new" menu, or how you can then link that entry to your AEGP...
I've found a workaround for this problem with finding the active timeline when another comp is locked. It works well for some purposes. First deselect all project items, i did this using
AEGP_SelectItem(first_item, false, true)). Then run AEGP_DoCommand(3696) (reveal comp in project) before you try to get the active timeline using AEGP_GetActiveItem. The side effect is that the comp is selected in the project view. If this is ok for you it seems to work fine.
I tried saving the selection in an array and then setting it back afterwards. It works but is very slow using AEGP_SelectItem. I tried a project with 20 items, it was pretty ugly, one selected at a time pretty slowly. I haven't found a better ways of manipulating item selections, do you know any? Would be nice to have something like layer collections..