Copy link to clipboard
Copied
var myOutsideGuide_Left = app.activeDocument.pages[0].graphicLines.add (app.activeDocument.layers.item ("Die"));
myOutsideGuide_Left.geometricBounds = ["0 in", "3 in", "10 in", "3 in"];
myOutsideGuide_Left.strokeDashAndGap = ["3 p", "3 p","3 p","3 p"];
myOutsideGuide_Left.strokeColor = app.activeDocument.colors.item("Black");
"myOutsideGuide_Left.strokeDashAndGap = ["3 p", "3 p","3 p","3 p"];" this line errors out and I'm stumped at what I'm missing.
Insight is greatly appreciated.
Thank you,
John
myOutsideGuide_Left.strokeType = "Dashed";
It seems you can only set the dash properties if the line is tagged as 'being dashed' in the first place!
Copy link to clipboard
Copied
myOutsideGuide_Left.strokeType = "Dashed";
It seems you can only set the dash properties if the line is tagged as 'being dashed' in the first place!
Copy link to clipboard
Copied
Thank you very much for taking the time to help with novice questions. It is greatly appreciated.
To recap:
(the following is for other uninitiate like me)
var myOutsideGuide_Left = app.activeDocument.pages[0].graphicLines.add (app.activeDocument.layers.item ("Die"));
myOutsideGuide_Left.geometricBounds = ["0 in", "3 in", "10 in", "3 in"];
myOutsideGuide_Left.strokeType = "Dashed";
myOutsideGuide_Left.strokeDashAndGap = ["3 p", "3 p","3 p","3 p"];
myOutsideGuide_Left.strokeColor = app.activeDocument.colors.item("Black");
Not using "myOutsideGuide_Left.strokeDashAndGap = ["3 p", "3 p","3 p","3 p"];" will use the default of whatever dash and gap is recorded in the stroke palette "Dashed" setting.
Thanks again for the help!
Copy link to clipboard
Copied
... whatever dash and gap is recorded in the stroke palette "Dashed" setting ..
I was wondering about that. This will still fail on other language versions of InDesign (because "Dashed" will be "Gestrichelt" or something like that), but I can only find one way of setting a line to a dashed style without knowing the name: loop over all stroke styles and use the first one that has a property "dashArray". Seems a bit ... troublesome?
Copy link to clipboard
Copied
Hi, Jongware!
$ID/
does it:
myOutsideGuide_Left.strokeType = "$ID/Dashed";
I tested that line on a German version of InDesign CS4 6.0.3 and InDesign CS3 5.0.4 on Mac OS X 10.5.7.
Without "$ID/" there was an error.
Greetings,
Uwe
Copy link to clipboard
Copied
Hi Uwe,
Thanks for posting that! It seems this invokes the built-in auto-translator, and having an English version only, no way I could have found that out, or even could've checked if it worked ...
Theun (aka [Jongware])
Copy link to clipboard
Copied
Hi, Theun!
Search for "$ID/" or "Localization" in the pdf or html-documentation of the InDesign CS4 SDK:
Feature development with Scripting.pdf
p12 "Localization"
or to clarify the issue:
ar42s03s05.html
see also:
idml-specification.pdf
p224 "IDML Example 62. Default StrokeStyles"
Greetings,
Uwe
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more