Skip to main content
Known Participant
June 4, 2020
Question

Script to count image opened in Photoshop according to orientation

  • June 4, 2020
  • 7 replies
  • 3910 views

Hi Please help me
Is there any script which can count number of horizontal and vertical image opened in photoshop and copy result text to clipboard.
For example I have 12 jpeg image opened in photoshop, out of which 9 are vertical and 3 are horizontal. Is there any script which can count them oriantation wise and copy text 9V3H to clipboard.

Thanks in advance

This topic has been closed for replies.

7 replies

Known Participant
June 30, 2021

I have opened 4Images, 2Verticle and 2Horizontal, I want to script according 2v2h , Is that possible to according orientation to alert(2v2h); ?

I have described in image, please check it ?

Thanks in Advance...

JJMack
Community Expert
Community Expert
June 30, 2021

I have no idea what you are asking. I see you have four image open in floating windows two have landscape aspect ratios  two have portrait aspect ratios they are being zoomed to different percentage the all see to have a different number of  pixels.  I have no Idea what you want a script to do?????

JJMack
Known Participant
June 30, 2021

I want to count the orientation of all images, Like 2h2v 

JJMack
Community Expert
Community Expert
June 4, 2020

There is no stupid question. If you do not know something and ask for help it not a sign of stupidity it show you want to learn. Scripts are little programs written is an interpreted scripting language. If you can find an existing script that does what you want it shows you are not the only one that works like you do.  If you can not find one you need to code it yourself. You will develop the best actions and scripts yourself for your work-flow. Because you designed them for your work and you know how the work and they work like you want them to.

JJMack
Legend
June 4, 2020

Test to see which is larger, horizontal size or vertical. Pretty straightforward.

PECourtejoie
Community Expert
Community Expert
June 4, 2020

Hi, Just in case, It is also possible to get the count of portrait, landscape, square files in a given folder using Adobe Bridge, without opening them.

Kukurykus
Legend
June 4, 2020

Or still by Photoshop by: ExternalObject.AdobeXMPScript

JJMack
Community Expert
Community Expert
June 4, 2020

A script can look at all the document open in Photoshop and look at their canvas sizes and count the number of landscapes and portraits and create a name like 9V3H and put out a message 9V3H,  Could even add as document 9V3H that has  a canvas sized to house all the documents visible composite and then stack each document current visible composite into the new document.  Photoshop Scripting is very powerful.  What you script is up to you when you code the script. To put text is the clipboard may require using some system code in Photoshop to copy text to the clipboard you normally have to be in text edit mode with the text highlighted you want to copy to the clipboard.  In Photoshop image are normally copied to the clipboard not text.  Photoshop is an image editor not a text editor though it can edit text to some extent.

JJMack
Known Participant
June 4, 2020

Thank you for your responce sir. I am totally new in scripting forum thats why sometime I ask stupid questions like this. Please don't mind. I tried to learn scripting but its very difficult for me as I am very less educated. I will not disturb anyone if anyone can provide me link from where I can learn more about scripting..from basic to advance 😞

Charu Rajput
Community Expert
Community Expert
June 4, 2020

Hi Chikal,

You are not disturbing anyone here. If you want to learn, you can read following articles for the scripting

 

Action Manager Scripting

 

ADOBE PHOTOSHOP SCRIPTING

 

Specifically documenattion for javascript

Adobe Photoshop CC JavaScript Reference

 

It will take some time to learn all these, but yes you can start by writing small scripts. All the best 🙂

 

Best regards
Stephen Marsh
Community Expert
Community Expert
June 4, 2020

The other topic thread was about retrieving the count and orientation of multiple layers in a single document.

 

Is this request different? You now have multiple documents open, all of which have different orientations, landscape, portrait and square? Do you still wish for the square orientation images to be classed as portrait orientation?

Community Expert
June 4, 2020

Ahh, i misread the question. My apologies for that

 

-Manan

-Manan
Community Expert
June 4, 2020
-Manan
Known Participant
June 4, 2020

Hi..That was different thread sir 😞