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

Guide positioning

Participant ,
Jul 22, 2022 Jul 22, 2022

It's easy enough to specify a guide position relative to the top or left edge of an image.  I do it regularly in distance, percent or even pixels.  Is there any simple way to specify the position relative to the bottom or right edge?  I'll want to put this in an action and apply it to images of differing aspect ratios.  Thanks. 

TOPICS
Actions and scripting , Windows
705
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

Community Expert , Jul 22, 2022 Jul 22, 2022

Please try

View > Guides > New Guide Layout 

Translate
Adobe
Community Expert ,
Jul 22, 2022 Jul 22, 2022

Please try

View > Guides > New Guide Layout 

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
Participant ,
Jul 22, 2022 Jul 22, 2022

Followup question.  The "New Guide Layout" solved my basic problem.  I'm happy.  But I'm also curious.  The dialog seems to allow for specifying the color but no matter what color I specify, the guides are black.  Guides dragged out from the edges follow the colors selected in preferences.  I can work around the black guides, but why can't I specify the color since the dialog seems to offer that option? 

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
LEGEND ,
Jul 22, 2022 Jul 22, 2022

Guides can be scripted as well, you can get the document size and calculate where to place a new guide from that.

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
Community Expert ,
Jul 22, 2022 Jul 22, 2022

@Lumigraphics wrote:

Guides can be scripted as well, you can get the document size and calculate where to place a new guide from that.




Yes, that was my thought too!

 

I hit a brick wall on the syntax for an arbitrary unit override:

 

#target photoshop
var savedRuler = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var rightEdge = activeDocument.height.value;
var bottomEdge = activeDocument.width.value;
activeDocument.guides.add(Direction.HORIZONTAL, rightEdge - 25);
activeDocument.guides.add(Direction.VERTICAL, bottomEdge - 25);
app.preferences.rulerUnits = savedRuler;

 

In the above example, I'm working in the rulerUnits of Units.PIXELS – using a 25px "offset" from the right hand side and bottom edge of the canvas for the guide position. But what if the offset needed to be say 10% of the canvas? The syntax of the override for UnitValue() was tripping me up.

 

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
Community Expert ,
Jul 22, 2022 Jul 22, 2022

Another way - drag from the top left of the rulers (where they intersect at the top left of the document window) and you can set the zero point to wherever you want e.g. bottom right. Now you can position guides using the ruler from that mark.

To reset the ruler zero point just double click on that same spot

 

Dave

 

 

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
Participant ,
Jul 22, 2022 Jul 22, 2022

Thank you all.  The "New Guide Layout" worked for what I need.  I had played with that earlier but didn't realize I could save and name a layout.  And then select that layout when recording the action.  Works just the way I wanted.  Every time I post here, someone has an answer that solves my problem.   Thanks again.

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
Community Expert ,
Jul 22, 2022 Jul 22, 2022
LATEST

@davescm wrote:

Another way - drag from the top left of the rulers (where they intersect at the top left of the document window) and you can set the zero point to wherever you want e.g. bottom right. Now you can position guides using the ruler from that mark.

To reset the ruler zero point just double click on that same spot

 

Dave


 

Adding to this alternative mentioned by Dave, setting the ruler origin point can't be recorded in an action, which limits what can be done with such automation. A script can change and reset the origin point:

 

https://community.adobe.com/t5/photoshop-ecosystem-discussions/feature-request-set-ruler-origin-loca...

 

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