Skip to main content
Participating Frequently
January 27, 2009
Question

Align to page

  • January 27, 2009
  • 12 replies
  • 929 views
Hi - new to using applescript
I've got a text box that I've made with Applescript. How can create my box, so that it is aligned to the bottom left of the page? I will be using this script on ID docs that are different sizes, but I will always need my text box at the bottom left.
This topic has been closed for replies.

12 replies

Inspiring
January 27, 2009
On 28/1/09 7:57 AM, "Kermy" <member@adobeforums.com> wrote:<br /><br />> How can create my box, so that it is aligned to the bottom left of the page?<br /><br />You set it's geometric bounds property accordingly. Perhaps if you posted<br />the code you have already, we could help.<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au><br />AppleScript Pro Florida, April 2009 <a href=http://scriptingmatters.com/aspro>
January 27, 2009
Something like this should do the trick...
tell application "Adobe InDesign CS3"

tell active document
--Standardize your coords
set zero point to {"0p", "0p"}
set horizontal measurement units of view preferences to picas
set vertical measurement units of view preferences to picas
set ruler origin of view preferences to page origin


--Define Doc & Box height/width
set thisDocHeight to page height of document preferences
set thisDocWidth to page width of document preferences
set boxHeight to 3 --pi
set boxWidth to 12 --pi

--Position in bottom right corner
-- using top,left,bottom,right coord system
set boxBounds to {thisDocHeight - boxHeight, 0, thisDocHeight, boxWidth}

--Place the boxes
tell every page
set myTextBox to make new text frame with properties {geometric bounds:boxBounds}
end tell
end tell
end tell