4 Replies Latest reply on Apr 12, 2013 3:11 AM by Harbs.

    Apply Master event

    Mac_06 Level 2

      Hi,

       

      I wanted to get notification once master page applied to document page that I can get using below event. But the issue is, it does not provide any information about which master page applied on which document page.

       

      Can someone help me out to know, How can I get that information?

       

        IDScriptingEventAdapter.getInstance().addEventListener(Event.MASTER_PAGE_APPLIED, masterApplyHandler);
       private
      
       function masterApplyHandler(event:Event):void
      {
       trace(event.parent) //Object Application
       trace(event.target) // Object Application
      
      }
      

       

      Thanks

      Mac

        • 1. Re: Apply Master event
          Mac_06 Level 2

          Harbs I would appriciate If you could throw some light on Scripting Event in CS Extension. How to grab the required information from MASTER_PAGE_APPLIED event ?

           

          Thanks in advance

          Mac

          • 2. Re: Apply Master event
            Harbs. Level 6

            Most events are simply wrappers on the standard InDesign scripting events so the functionality is determined by the scripting behavior. Some of the events (such as the one you mention) are events specific to the InDesign host adapter and are dispatched by the host adapter plugin. (You can't use those events if the host adapter is not installed on the client's machine.)

             

            I have not used the MASTER_PAGE_APPLIED event. What's the event type? Is there some kind of payload? If not, you will have to figure out yourself which master is applied. You might be able to cache the applied master pages and see what changed.

            • 3. Re: Apply Master event
              Mac_06 Level 2

              Thanks a lot Harbs for valuable information.

              Harbs. wrote:

              I have not used the MASTER_PAGE_APPLIED event. What's the event type? Is there some kind of payload? If not, you will have to figure out yourself which master is applied. You might be able to cache the applied master pages and see what changed.

              Event type is masterPageApplied event triggers whenever any master page applied to document page. I don't know if there is any kind of payload but as per my understanding, no.

              I'd try to figure out more insight.

              • 4. Re: Apply Master event
                Harbs. Level 6

                I don't mean Event.type. I mean is it Event or some subclass of Event. Simple Event objects do not have payloads. That's why I asked...

                 

                You're probably going to have to keep an Array of the applied masters and figure out which one changed to do your thing.

                 

                If you want, you can check out APID which has events for applying master pages that are quite useful...

                http://www.rorohiko.com/wordpress/indesign-downloads/active-page-item-developer/

                1 person found this helpful