Copy link to clipboard
Copied
Hi folks,
I'm working with a large batch of studio photographs — they are mostly compositionally the same but need regularly-spaced guides around them. First, I need to place a guide manually (usually on the x axis), then add 50px on either side of that guide, totaling 3. To save some time trying to do the calculations in my head and working with finicky rulers, I wonder if someone might help me locate a script that can automatically add guides based on the location of a first guide? This would save so much time in my workflow. A simple graphic is attached to hopefully help explain!
Thank you!
1 Correct answer
Try this script
if (activeDocument.guides.length == 1)
{
var g0 = activeDocument.guides[0];
activeDocument.guides.add(g0.direction, UnitValue(g0.coordinate.as("px") + 50, "px"));
activeDocument.guides.add(g0.direction, UnitValue(g0.coordinate.as("px") - 50, "px"));
}
else
{
alert("Bad guides");
}
Explore related tutorials & articles
Copy link to clipboard
Copied
Try this script
if (activeDocument.guides.length == 1)
{
var g0 = activeDocument.guides[0];
activeDocument.guides.add(g0.direction, UnitValue(g0.coordinate.as("px") + 50, "px"));
activeDocument.guides.add(g0.direction, UnitValue(g0.coordinate.as("px") - 50, "px"));
}
else
{
alert("Bad guides");
}
Copy link to clipboard
Copied
Amazing! Seems to be working like a charm! Thanks so much.

