0

Can I control a rectangle's anchor on the left with a script up or down (like in the picture).

var Rctngl=0;
var var_Integer;
mm = 2.834645731787465
var_Integer =Rctngl;
var_Integer = prompt ("Rectangle ?", var_Integer);
{  Rctngl = Math.floor (var_Integer)*mm }
app.activeDocument.defaultStroke = true;
app.activeDocument.defaultStrokeWidth = 4;
app.activeDocument.defaultFilled = false;
var box = app.activeDocument.layers[0].groupItems.add()
box.pathItems.rectangle (0, 0,  Rctngl*2, Rctngl*2);

enter image description here

11
  • Sure, but why bother? Anyway theres not really enough context here to sufgest anything useful.
    – joojaa
    Dec 13, 2020 at 16:02
  • sorry i added my code
    – enisio
    Dec 13, 2020 at 16:48
  • Probably better to use setEntirePath instead of rectangle
    – joojaa
    Dec 13, 2020 at 17:16
  • I don't particularly want to use setEntirePath. Can only the anchors of the Rectangle be intervened?
    – enisio
    Dec 13, 2020 at 17:42
  • sure but its just unnecessarily many lines of code. Why write 6 extra lines of code and take a performance hit of doing the same thing 3 times?
    – joojaa
    Dec 13, 2020 at 18:07

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.