Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Script for Adding Guides Based on Location of 1 Guide

New Here ,
Jan 28, 2023 Jan 28, 2023

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!

TOPICS
Actions and scripting
420
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

People's Champ , Jan 28, 2023 Jan 28, 2023

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");
    }
Translate
Adobe
People's Champ ,
Jan 28, 2023 Jan 28, 2023

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");
    }
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 30, 2023 Jan 30, 2023
LATEST

Amazing! Seems to be working like a charm! Thanks so much. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines