I have a 3 page ID document. I am trying to take the 8-1/2 x 11 graphic on page 3, duplicate it to page 2, then position in a specific location, and then rotate it 180 degrees into position. I think I am running into a similar problem as my last post in that ID doesn’t always leave my duplicated object with the same consistent anchor point selected. I think it’s taking whatever point was used in the last document.
How do I specifically tell indesign WHICH anchor point to use before I apply a transformation, whether it’s a move, or a rotate.
Here is a snippet of my code:
tell page 3 of document 1
set myBox3 to make rectangle with properties {geometric bounds:{0, 8.5, 11, 17}, stroke weight:"0"}
tell myBox3
try
place file MySheetPDF
fit myBox3 given center content
on error
display dialog "SHEET missing"
end try
end tell
end tell
--get ready to duplicate page 3 and rotate it onto page 2
--this puts the graphic box flush in the upper left corner of page 2
set MyDup to duplicate myBox3 to page 2 of document 1
tell page 2 of document 1
--because I can't figure out the page origins correctly this works to resize my box to 2.5 x 2.625
set geometric bounds of MyDup to {0, 8.5, 2.5, 11.125}
--this moves my box to the correct position on the page, but might be wrong depending on the anchor point
move MyDup to {11.5, 5.5}
--this rotates my box, but might be wrong depending on anchor point
set absolute rotation angle of MyDup to 180
end tell
thanks
david
I dont understand why your using Move. Why not just make the box at the coordinates you need? IE simply set them. Maybe your first task should be to reset page origins so it is in a known position, that’s not hard to do. You can even read the offset and re-apply it later if you need to have it different than the 0,0 point.
Well… I had a post or three earlier that discussed the issue of where the page origin was, and we couldn’t determine why I couldn’t get my 0,0 coord to appear at the upper left corner of each page. Currently, for some reason, the origin is the upper left of page 1. I suppose that it has something to do with how my pages and spreads are set up to begin with.
I am new to InDesign in the last year, so I’m not quite clear of the page origins since it really doesn’t affect us much otherwise.
How would I go about resetting the page origins? Any comment on the proper code to set the anchor point of the box? Of course, as I type this, I am thinking that I will search the dictionary for anchor points…
david
p.s. we aren’t that far away, I am in West Chester.
Hi Dave,
I only skimmed the other post of yours last week. Hopefully this isn’t too redundant:
tell application "Adobe InDesign CS5"
tell document 1
set zero point to {0, 0} --reset 0 point of doc to upper left
tell view preferences
set horizontal measurement units to picas
set vertical measurement units to picas
set ruler origin to page origin --spread origin/page origin
--ie if page 2 on a spread "restarts" it's coordinates to 0 thru 8.5 inches
--if set to spread then p2 goes from 8.5 to 17 inches (letter size)
end tell
tell guide preferences
set guides shown to true
set guides snapto to true
end tell
end tell
end tell
I could come over to help out (for hire of course)