macro request - carry out a function when a page is added or deleted

Hi.  I am building a macro that needs to watch for a change in the document status like adding or deleting a page.  Any help out there?

Example:

when page is added or deleted-

look for object label "toasty"

carry out a function like add total page number