Selecting only 2pt rules

I have a bunch of indesign files. I am trying to write a script that will open each file, get the height and width of the document, then select the 2 lines on the page that are 2pt thick rules. Once I have them, I want to perform the math to figure out the distance between them.

I am just having a hard time getting the lines selected.

	tell page 1 of front document
				-- gather details of document
				set DocWidth to page width of document preferences of MyDoc
				set DocHeigth to page height of document preferences of MyDoc
				set (selected of every graphic line whose stroke is "2 pt") to true
			
			end tell

I get an error that says
"can’t set selected of every graphic line of page 1 of document 1 whose stroke = “2 pt” to true

any ideas?

thanks david

Hi. Unless changes were made in later versions, the past tense form of select doesn’t exist in ID’s dictionary. Try:

		select (graphic lines whose stroke weight is 2)

or this, to filter out nonexistent lines:

		tell (graphic lines whose stroke weight is 2) to if not it is {} then select

excellent… that’s just what the doc ordered. :slight_smile:
thanks
david