I’m righting an applescript to make crop marks around my page in InDesign. My problem is that my script is based on a ruler origin at top left corner of the page. So if a document append to have a different ruler origin, my crop marks are not at the right place.
So my question is:
Is there a way to reset this ruler origin in my script to move it back to the top left corner of the page?
There are two properties of the document that you might want to consider taking into consideration so that your script works on all documents, the zero point and the ruler origin.
The zero point is the position of the zero point on the page for the document and is a property of the document.
The ruler origin is default zero point of the document for the ruler .
The below script checks each and sets them to a desired location and resets them to the user’s settings before ending.
tell application "Adobe InDesign CS3"
tell document 1
set rulerOrigin to ruler origin of view preferences
if rulerOrigin is not page origin then set ruler origin of view preferences to page origin --(spread origin/page origin/spine origin)
set rulerZeroPoint to zero point
if rulerZeroPoint is not {0, 0} then set zero point to {0, 0}
--Do Stuff
--Reset zero point and ruler origin
set zero point to rulerZeroPoint
set ruler origin of view preferences to rulerOrigin
end tell
end tell
just swap out the code in the script with this, you’ll find it in the first handler.
tell the result
set myCropMarkLengthField to make measurement editbox with properties {edit value:28.346, edit units:points}
set myCropMarkOffsetField to make measurement editbox with properties {edit value:14.173, edit units:points}
set myCropMarkWidthField to make measurement editbox with properties {edit value:1, edit units:points}
end tell
end tell
set myRegMarksGroup to make enabling group with properties {static label:"Registration Marks", checked state:false}
I’m not able to get the following line of code to work, whether I target a document or the app itself (to set prefs for all new docs):
set ruler origin of view preferences to page origin
The error returned is “Syntax Error: expected expression but found unknown token.”
Anyone have any ideas/clues as to what’s going on?
tell application "Adobe InDesign CS6"
set myDocument to active document
set ruler origin of view preferences of myDocument to page origin -- start coordinates for rulers from each page
end tell