photoshop-python-api
photoshop-python-api copied to clipboard
How to rotate a selection ?
Hello. I have a problem with the API :
I make a selection in the document with script : app.activeDocument.selection.select(sel_area, ps.SelectionType.ReplaceSelection, 0, False) Work !
I want to rotate this selection but I need 2 argument and I can't set anchorposition (I want middlecenter) : app.activeDocument.selection.rotate(20 , ????? ) How can I set anchorposition please ?
Many thanks in advance
Sébastien
@djs45 Please try the below codes
from photoshop import Session
with Session() as ps:
app = ps.app
doc = app.activeDocument
doc.selection.rotate(90, ps.AnchorPosition.MiddleCenter)