selection.rotate

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

MaxAsk
Posts: 2
Joined: Tue Jan 09, 2018 7:38 pm

selection.rotate

Post by MaxAsk »

Hi, everybody! I'm writing a script for photoshop used the ExtendScriptToolkit. And i need to rotate the selection area. For example i do this

Code: Select all

selection.rotate(10)
. But, script stopped on this line and report that is "General error photoshop. This feature may not be available in the current version of photoshop". Photoshop CC 2018. I looked in the menu "Selection" and not found item "rotate"!!! How so? Only transform! What is the

Code: Select all

selection.rotate
? Or i have pared-down functionality of the program?
Thanks for look!
User avatar
Kukurykus
Posts: 528
Joined: Mon Jul 25, 2016 12:36 pm

Re: selection.rotate

Post by Kukurykus »

Code: Select all

activeDocument.selection.rotate(10, AnchorPosition.MIDDLECENTER)
MaxAsk
Posts: 2
Joined: Tue Jan 09, 2018 7:38 pm

Re: selection.rotate

Post by MaxAsk »

Thanks and sorry! I was inattentive and hasty. I tried to rotate the selection on a new empty layer :lol:.
Gave a tip to Photoshop CS2 and his ESTK (which unlike Photoshop CC2018 reacted to this error with an excellent prompt):
you are trying to rotate the empty pixels.
I colored the layer and everything worked as it should!
Good luck and good code everybody!