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

Photoshop script rotate all open images counterclockwise

Community Beginner ,
Dec 29, 2021 Dec 29, 2021

Copy link to clipboard

Copied

Hello!

I have a question:
can a script rotate all open images counterclockwise?
It has become a daily routine for me, and takes a long time...
I would be very grateful for your answers,
Niyetkhan
TOPICS
Actions and scripting , Windows

Views

1.4K

Translate

Translate

Report

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

LEGEND , Dec 29, 2021 Dec 29, 2021

Modify 'apply to all open documents' script I shared with you in other thread, by using:

 

activeDocument.rotateCanvas(-90)

 

Votes

Translate

Translate
Adobe
Community Expert ,
Dec 29, 2021 Dec 29, 2021

Copy link to clipboard

Copied

Does it have to be a Script. A simple one step action is all that is needed.  Menu Image>Image Rotation>90  Counter Clockwise.

Capture.jpg

 It would be easy to script that batch process. But it will take you a long time to write that script for you asked that question so you do not know how to Script Photoshop.  Scripting is no an easy task like recording an action.

JJMack

Votes

Translate

Translate

Report

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 ,
Dec 29, 2021 Dec 29, 2021

Copy link to clipboard

Copied

Modify 'apply to all open documents' script I shared with you in other thread, by using:

 

activeDocument.rotateCanvas(-90)

 

Votes

Translate

Translate

Report

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 Beginner ,
Dec 29, 2021 Dec 29, 2021

Copy link to clipboard

Copied

I tried it

But there is an error:

dcmnts = [].slice.call(documents);
while(dcmnts.length) shft = dcmnts.shift(),
(aD = activeDocument.rotateCanvas(-90)

 

Без имени-1.jpg

Votes

Translate

Translate

Report

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 ,
Dec 30, 2021 Dec 30, 2021

Copy link to clipboard

Copied


@niyetkhan wrote:

I tried it

But there is an error:

dcmnts = [].slice.call(documents);
while(dcmnts.length) shft = dcmnts.shift(),
(aD = activeDocument.rotateCanvas(-90)

 

Без имени-1.jpg


 

That error message is telling you that there is an unmatched closing parentheses character missing on the last line:

 

dcmnts = [].slice.call(documents);
while(dcmnts.length) shft = dcmnts.shift(),
(aD = activeDocument.rotateCanvas(-90));

 

However, even then I don't think that is correct, I believe that it should be:

 

dcmnts = [].slice.call(documents);
while (dcmnts.length) shft = dcmnts.shift(),
    (aD = app.activeDocument = shft).rotateCanvas(-90);

 

Votes

Translate

Translate

Report

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 ,
Dec 30, 2021 Dec 30, 2021

Copy link to clipboard

Copied

LATEST

for the sake of completeness:

dcmnts = [].slice.call(documents); while(dcmnts.length)
	(activeDocument = dcmnts.shift()).rotateCanvas(-90)

Votes

Translate

Translate

Report

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 Beginner ,
Dec 29, 2021 Dec 29, 2021

Copy link to clipboard

Copied

Thank you very much!!!

Votes

Translate

Translate

Report

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 ,
Dec 30, 2021 Dec 30, 2021

Copy link to clipboard

Copied


@Kukurykus wrote:

Modify 'apply to all open documents' script I shared with you in other thread, by using:

 

activeDocument.rotateCanvas(-90)

 



Just for future reference in case anybody is looking for said script:

 

 
And just in case Adobe break the forum links again in a future forum software change:
 
dcmnts = [].slice.call(documents);
while (dcmnts.length) shft = dcmnts.shift(),
    (aD = app.activeDocument = shft).activeLayer.desaturate();

Votes

Translate

Translate

Report

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 ,
Dec 30, 2021 Dec 30, 2021

Copy link to clipboard

Copied

I think what the op wanted would  be mote like this:

 

 

 

 

 

if (documents.length){for (var i=0;i<documents.length;i++){documents[i].rotateCanvas(-90);}}

 

 

 

 

Rotate.gif

 

 

JJMack

Votes

Translate

Translate

Report

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 ,
Dec 30, 2021 Dec 30, 2021

Copy link to clipboard

Copied

You missed the backstory, but it doesn't really matter.

Votes

Translate

Translate

Report

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 ,
Dec 30, 2021 Dec 30, 2021

Copy link to clipboard

Copied

I know it does not matter but it is what the op asked about.

JJMack

Votes

Translate

Translate

Report

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 ,
Dec 30, 2021 Dec 30, 2021

Copy link to clipboard

Copied

I meant that the back-story didn't matter as I thought that I had documented it to help those in the future reading this topic thread.

 

1) niyetkhan asks the original question

2) Kukurykus replied that it is the same as the other question from niyetkhan and provided the replacement code, but didn't explicity state where to change the code or provide the link for previous code

3) niyetkhan marked this as the correct answer

4) I then supplied the link to the previous topic and provided the code from the previous topic so that this topic would be more helpful for future visitors

 

I guess the only thing left to do is change the previous code with the new addition, which required a minor edit to work:

 

dcmnts = [].slice.call(documents);
while (dcmnts.length) shft = dcmnts.shift(),
    (aD = app.activeDocument = shft).rotateCanvas(-90);

 

 

Votes

Translate

Translate

Report

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 ,
Dec 30, 2021 Dec 30, 2021

Copy link to clipboard

Copied

He only didn't know exact command, not the method to do it for all documents.

Votes

Translate

Translate

Report

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 ,
Dec 30, 2021 Dec 30, 2021

Copy link to clipboard

Copied

Is that youer interpretation of 

I have a question:
can a script rotate all open images counterclockwise?

one is all not in book however, I always failed English 

JJMack

Votes

Translate

Translate

Report

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 ,
Dec 30, 2021 Dec 30, 2021

Copy link to clipboard

Copied

Stephen_A_Marsh 'tried' to explain it but you don't understand. Read text of my first answer.

Votes

Translate

Translate

Report

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 ,
Dec 30, 2021 Dec 30, 2021

Copy link to clipboard

Copied

Modify 'apply to all open documents' script I shared with you in other thread, by using:

 

Without the link it hard to to tell what else the share script would do.  Its a one liner in the first place

if (documents.length)for(var i=0;i<documents.length;i++)documents[i].rotateCanvas(-90)
JJMack

Votes

Translate

Translate

Report

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 ,
Dec 30, 2021 Dec 30, 2021

Copy link to clipboard

Copied

Be smart and click his username profile to open previous thread created by him.

 

btw why you're again post a code you once posted?

Votes

Translate

Translate

Report

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 ,
Dec 30, 2021 Dec 30, 2021

Copy link to clipboard

Copied

It would surely be easier to do it in Bridge.

Votes

Translate

Translate

Report

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 ,
Dec 30, 2021 Dec 30, 2021

Copy link to clipboard

Copied

I agree... As long as all the software in the viewing and editing chain respects the orientation metadata.

 

Edit: forgot to mention that if rotated in Bridge and then re-saved in say Photoshop, the new rotation will be "baked in" and no longer reliant on metadata for rotation.

Votes

Translate

Translate

Report

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