an inDesign script developed by caroljpeg to realize Descrizione di una battaglia.
if you're interested in the project, you can read more about it at this link descrizione di una battaglia
note that this is not the complete code used in the project: if you want to give it a look,
you can find it in this github repository
this release is intended to be an open source generalization of the tool i developed to realize my project.
if you have any question or you want to share what you used it for, feel free to contact me at a.martinelli0601@gmail.com
this script allows you to find every iterations of a word in the page of an indesign document and creates a line
that starts from each one of the iterations and follows a series of anchor points provided by the user
in order to get ready to use this script, you firstly need to download this respository.
once you've done it open the VeinsAndArteriesTool.jsx file in your code editor.
-
-
define the width and height of your page at line 5-6
-
define the word you want the lines to start from at line 10
-
define the x and y value for the point you want the lines to converge (line 18-19)
-
define the x and y value of the anchor points you want the lines to pass through (lines 17-37).
for each value you need, you just have to addvar x = yourXValue;and/orvar y = yourYValue;
in simple systems you may skip this step and specify those values during the following one.
-
-
- combine the x and y values you defined before for a single anchorPath in the array paths (lines 47-69). your code should look like this:
var paths = { 'anchorPath':[ [resX, resY], [x, y], [...] [originX, originY] ] }- use the code provided at lines 76-86.
-
-
repeat the process described in 2.iv as many times as you wish, remembering to assign different names to the paths.
-
use the code provided at lines 90-129, replacing
yourConditionandyourCondition2with your own conditions and defining, for every condition, the path you want to be used in that specific case.
-
-
you can addrandom values at every step of the function using the genRand function provided at lines 137-147. just write, instead of a numeric value, the expression
genRand(min, max, decimalPlaces),
where min is the minimum value for the function to choose, max is the maximum value for the function to choose
and decimalPlaces is the number of decimal position for the output value (if you want an integer insert 0).
once you completed this steps you can save the script in the scripts folder:
on macos
/Users/<username>/Library/Preferences/Adobe InDesign/Version 18.0/<locale>/Scripts
on windows
C:\Users\<username>\AppData\Roaming\Adobe\InDesign\Version 18.0\<locale>\Scripts
now open indesign, go to the scripts panel and simply doubleclick on VeinsAndArteriesTool.jsx.
