Skip to main content
Participating Frequently
March 19, 2008
Question

On what page am I?

  • March 19, 2008
  • 5 replies
  • 551 views
Hello!

For a plugin I must know on which page (in which chapter, section too but that should work the same way) a specific text index (or rather an owned item anchored there) in a text model resides.
I know how to find that out, the problem is that I need that information to be always up to date. The page number marker provided by InDesign is able to stay up to date somehow and I'd need to know how it does that.

I guess some kind of observer but I wasn't able to find how to attach one for that purpose. Can someone help me here?

Regards,
Martin
This topic has been closed for replies.

5 replies

Participating Frequently
March 20, 2008
Thanks Dirk for your hints. I'll try the service, looks promising.
How to write a service seems to be well documented, so don't fear I'll ask how to. ;)
Problem for me mostly is not how to implement xy but what to implement to get xy done.

Thanks,
Martin
Inspiring
March 20, 2008
You should implement a text post process service.
The thread below is about its twin, the pre process service.

Muhammad Amin, "Creating Observers for X and Y ScaleText Attributes" #, 28 Nov 2007 4:22 am

How would you know?
- read the forum for a few years
- ask
- there is some place on the web that has a copy from older postings
- find where the application already works the same way, and have a deeper look at the matching plugin's boss list in the SDK docs. Drill down from there on interesting bosses to see their interfaces.

On the positive side, most interfaces are available as header. Please don't ask though how to write your own selection service.

Dirk
Participating Frequently
March 20, 2008
Ok, so this means there is no single point to look at. Instead I've to observe nearly each distinct way an item can move? That's a lot and I fear this will slow down the whole app but I'll have to try.

Did I miss some documentation or why can't I find informations on some interfaces like IID_ITRANSFORM_DOCUMENT? None in the API reference, only one occurence in a sdk sample. How did you find that?

And also as far as I can see you didn't mention what to observe for getting notified if a particular item (e.g. a table) moves within a story. I don't expect one to deliver me complete answers if I only knew where to look.

Thanks,
Martin
Participating Frequently
March 19, 2008
also IID_ISPREADLIST maybe needed too.

thanks!
lee
Participating Frequently
March 19, 2008
Martin,

Try an observer with lazy attachment on the following protocol:

Session workspace subject: IID_IPAGENUMBERPREFS
Doc subject: IID_ITRANSFORM_DOCUMENT, IID_ISECTIONLIST

These are broadcasted in many commands that can change the page number of the item you're watching. There maybe other protocol to observe, so let the list know if this works or not.

Hope this helps!
lee