Skip to main content
Participating Frequently
September 7, 2010
Answered

Reset ruler origin

  • September 7, 2010
  • 2 replies
  • 3275 views

Hi,

I'm writing a script in javascript who have to return the position of every box of a indd document. To do this stuff i have to reset the ruler origin in order to get a unique coordinate system, because users manually change the ruler origin as they like. In Indesign client it's simple: you have to set "ruler on spine" and automatically the origin is set in the top-left corner and you can't change it. I've try to do the same thing in my script :

app.viewPreferences.rulerOrigin = RulerOrigin.SPINE_ORIGIN;
theDocument.viewPreferences.rulerOrigin = RulerOrigin.SPINE_ORIGIN;

but it doesn't work. The ruler origin don't change.

I'm doing something wrong or there is another method to obtain what i want?

Thank you in advance.

Massimo

This topic has been closed for replies.
Correct answer Jongware

You don't have to set the ruler option for the application -- in fact, that will do quite the opposite, as it will set it as default for new documents but not change the current one! Setting it for your current document is enough.

Try setting theDocument.zeroPoint to [0,0] after changing the origin.

2 replies

tomaxxi
Inspiring
September 7, 2010

Hey!

Try this:

app.viewPreferences.rulerOrigin = RulerOrigin.SPINE_ORIGIN;
app.activeDocument.viewPreferences.rulerOrigin = RulerOrigin.SPINE_ORIGIN;
app.activeDocument.zeroPoint = [0,0];

--

tomaxxi

http://indisnip.wordpress.com/

Jongware
Community Expert
JongwareCommunity ExpertCorrect answer
Community Expert
September 7, 2010

You don't have to set the ruler option for the application -- in fact, that will do quite the opposite, as it will set it as default for new documents but not change the current one! Setting it for your current document is enough.

Try setting theDocument.zeroPoint to [0,0] after changing the origin.

tomaxxi
Inspiring
September 7, 2010

Ok, I'm slow

--

tomaxxi

http://indisnip.wordpress.com/

Participating Frequently
September 7, 2010

Thank you very much!

zeroPoint=[0,0] is what i needed