I am working on a project and trying to use applescript to complete it. It will be faster for me to do this process manually, but I want to learn how to use applescript to solve the problem.
I have a number of indesign template files. They all have crop marks and such on them. Some documents have 1 page others have 2 pages. I’m not concerned about that. On page 1 of the document there could be specific lines that I am interested in - these are the lines that show where lamination has to go between. They will be the ONLY lines that are of weight 2 pts. I am storing the ids of the lines in a list:
set MyLamLines to (every graphic line whose stroke weight is 2)
set NumLines to number of items in MyLamLines
i know that I can store each of the 4 coords of the given line using:
set MyBoundsFirst to geometric bounds of item j of MyLamLines
set MyBoundsSecond to geometric bounds of item (j+1) of MyLamLines
and I know that IF i only had two lines in MyLamLines I could easily figure out the distance between them.
my complicated question is: When I have more than 2 lines in MyLamLines what is the best way to figure out which lines go together, and what are the distances between them.
see here for a screen shot:
https://www.dropbox.com/s/dit0lrcijodokbj/Screen%20Shot%202016-09-25%20at%2010.57.10%20PM.png?dl=0
I think some of the guidelines needed are:
- is the line a vertical or horizontal line. Lines can only pair together if they are oriented the same direction
- if line 1 and line 2 are being compared, and they are not of the same orientation, then go on to the next line.
- if line 1 and the next line are the same orientation, then do they have the same X1 value?
This is where I start getting confused. Is there an easier way to accomplish this? Is this enough information to understand what I am asking?
I love learning the correct way to do these things, but I need to be able to understand what I’m doing too.
thanks for any help…
david