This content has been marked as final. Show 10 replies
You have facing pages in your document. Objects on the left have different coordinates than the ones on the right.
If you run this script on a document without facing pages, it will work as you expected. If you need it to run on a facing document, you will need to determine what should be placed in the "left" position and what in the "right" position. The difference between the left and right position is exactly the current page width.
jongware wrote: "Objects on the left have different coordinates than the ones on the right."
Or, more specifically, the coordinates depend on the current setting of the ruler origin and zero point. If you set your rulers to RulerOrigin.pageOrigin (which is what I always do), you can use the same coordinates, regardless of the location of the page in the spread and/or facing pages settings. (Thanks for helping, jongware!)
Ow, Ole, didn't know that.
I suppose I could make a couple of my scripts a bit easier now by toggling that RulerOrigin.
Hi Ole and jongware,
Thank u friends.
Tell, pls, how to correctly write this trick?
I tried this:
Set MyInd = CreateObject("InDesign.Application.CS3")
MyInd.idRulerOrigin = idRulerOrigin.idPageOrigin 'says doesnt support...
MyInd.idRulerOrigin = idPageOrigin 'the same
MyInd.idRulerOrigin.idPageOrigin 'the same
I think the named enumerations don't work at all in VB. Try using the constant numbers instead. They are
SPREAD_ORIGIN 1380143983 = "RCSo"
PAGE_ORIGIN 1380143215 = "RCPo"
SPINE_ORIGIN 1380143984 = "RCSp"
You can try the ASCII versions as well, they might or might not work.
>MyInd.idRulerOrigin = "RCPo"
>MyInd.idRulerOrigin = 1380143215
is sure to work.
Unfortunately it dont want to work anyway. OK. I used manual way. May be later i'll try this in JS.
You can try this. This is working in vb.net. With a little changes i hope it will work.
mydoc = myind.ActiveDocument
mydoc.ViewPreferences.RulerOrigin = idRulerOrigin.idPageOrigin
I am new to indesign scripting.
Thanks. But a little correction. There is a need to add "Set" before assinging value for mydoc (in VBA). Otherwise it says "error".
This does works:
Set myDoc = mInd.ActiveDocument
myDoc.ViewPreferences.RulerOrigin = idRulerOrigin.idPageOrigin
No need to add Set keyword if u use vb.net. I don't have any idea about vb.