Not sure how to ask for help on this one, but let me know if I'm not clear enough. I'm definitely a rookie.
I have a doScript with a function that I want to draw a graphic line.
var xPlace=xLoc[XOholder+1];
lineDrarwing(xPlace);
function lineDrarwing (xPlace) {
var myPageDD = app.activeWindow.activePage;
var myMarginsDD = myPageDD.marginPreferences;
var BotMarginDD = [myPageDD.bounds[2]-myMarginsDD.bottom];
var SMLogoYCDD=BotMarginDD;
var SMLogoYADD=BotMarginDD-lineHT;
var myGraphicLine = myPage.graphicLines.add({ strokeColor: SMLineColor, strokeWeight: SMLogoStrk });
myGraphicLine.paths.item(0).pathPoints.item(0).anchor = [xPlace, SMLogoYADD]; // X1, Y1
myGraphicLine.paths.item(0).pathPoints.item(1).anchor = [xPlace, SMLogoYCDD]; // X2, Y2
myGraphicLine.select();
myGraphicLine.label="Line SM Icon";
mySel.transparencySettings.blendingSettings.blendMode= BlendMode.NORMAL;
}
The problem that I've narrowed down to is with the variable SMLogoYCDD in the line above
myGraphicLine.paths.item(0).pathPoints.item(1).anchor = [xPlace, SMLogoYCDD];
If I replace that with a number, the script works great. My goal is that I can use a variable there.
It's strange that the other variables work just fine; except that last one. I can't figure out why. I've tried renaming the variable, replacing it with BotMarginDD, etc. I've placed an alert just before that line to tell me what the value of SMLogoYCDD is - and that works fine in the alert, but fails in the executioin in the line following. There aren't any other variables with the name SMLogoYCDD, so it's getting confused somewhere. The error I get is "Error: No data available of the requested type."
Just in case you were wondering, the variable xPlace works fine. It looks at array named xLoc, and gets a number located at space [XOholder+1]
Thanks in advance for any help.