Reseting InDesign ruler origin to top left corner

Hy guys,

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?

Thanks

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

Thanks!

This is exactly what i was looking for. It work perfectly. I was missing the zero point part!

Hi

Please help me with this problem - I need my CropMarks.applescript from InDesign CS5
always "start up like this:

Crop Marks (ON)
Length= 10mm (28,346pt)
Offset= 5mm (14,173pt)
Stroke Weight= OK

Make Registrations Marks NOT active

Draw marks around (like it is) Each Object

Henrik
Denmark

Model: imac
Browser: Firefox 3.6.11
Operating System: Mac OS X (10.6)

hi HenneRikke

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}

THANKS Budgie

I´t work perfectly

HenneRikke

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?

Thanks,

  • Dan

can you post your complete code

this works fine here

tell application "Adobe InDesign CC"
	tell active document
		set ruler origin of view preferences to page origin
	end tell
end tell

Hi, try it:


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