Skip to main content
gregd
Inspiring
October 18, 2023
Answered

How do you create a guide layout with set inner dimensions that is centered on the image?

  • October 18, 2023
  • 4 replies
  • 628 views

I want to define a 100x100 pixel square in the center of an images of arbitrary sizes using guides, and I'd like to do it through an action so I can use it with automate batch. How can I do this?

I feel like I should be able to do this with New Guide Layout, but for some reason it doesn't have an option to center rows.

This topic has been closed for replies.
Correct answer Semaphoric

How about this:

 

4 replies

Stephen Marsh
Community Expert
Community Expert
October 20, 2023

@gregd – are you still out there?

Semaphoric
Community Expert
SemaphoricCommunity ExpertCorrect answer
Community Expert
October 18, 2023

How about this:

 

Stephen Marsh
Community Expert
Community Expert
October 18, 2023

@Semaphoric – Even better!

Stephen Marsh
Community Expert
Community Expert
October 18, 2023

Something like this?

Otherwise, a scripted option that can be recorded into the action for batching:

 

#target photoshop;
//activeDocument.guides.removeAll();
var savedRuler = app.preferences.rulerUnits;        
app.preferences.rulerUnits = Units.PIXELS;
var hCentre = activeDocument.width/2;
var vCentre = activeDocument.height/2;
activeDocument.guides.add(Direction.HORIZONTAL, vCentre + 50);
activeDocument.guides.add(Direction.HORIZONTAL, vCentre - 50);
activeDocument.guides.add(Direction.VERTICAL, hCentre + 50);
activeDocument.guides.add(Direction.VERTICAL, hCentre - 50);
app.preferences.rulerUnits = savedRuler;    

 

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

jane-e
Community Expert
Community Expert
October 18, 2023

@gregd 

 

Can you show a screenshot of your new guides layout panel? What are you trying to do that it's not doing?

 

Jane

gregd
gregdAuthor
Inspiring
October 18, 2023

Here you go. The 100x100 area isn't centered vertically. How do I fix that?