Automatic rotate

is there a way to achieve an automatic rotate of an image?
I mean:
I’d like a script that sets a tag on an image accordingly to my needs. I’d call it “sticky rotate”, meaning that when I press (say) F6 key when a “fresh” document is selected and viewed, it rotates the image right, and assigns the “rotation90” tag to the image, if I press the key once again the script recognizes it has the “rotation90” tag so its being substituted with “rotation180” and rotates the image right again…and so on.
When the event of selecting, and so displaying, a document (image) occurs, I’d like DT to rotate it automatically accordingly to a tag it has attached.
For example:
if the image has the tag “rotation90” I want DevonThink to automatically rotate the image 90° right when it is displayed. When it has the tag “rotation180” I want DT to rotate 90°right TWICE, i.e. 180°. When it has the tag “rotation270” I want DT to rotate the image 90° left, when the image is being selected.

I hope I have been clear enough…

Just curious. Why would you want to go to all this trouble?

Because Devonthink doesn’t keep the orientation I set for an image!
For example, if you have some images that are landscape oriented, instead of being correctly displayed like that, they are stored in DT as portrait.
I don’t want to have to rotate them everytime I scrub through them to read. I need the rotation setting to be sticky.
In DT if you rotate an image, then select another image, then return to image you rotated the orientation you changed is not mantained, but reset to the original status. I can’t understand why it has this behaviour by design.

I believe if you use the scripts under the script menu>Images, the rotation of the image will be saved.

Did you try it? I will try when I get back to my mac. But if I remember well… I am using F5-F6 shortcuts to launch the rotate image left-right scripts. And it doesn’t save the rotation.

Yes, the scripts do save the image rotation for me. I don’t call them with a shortcut, however-I just use the menu as I seldom need to do this.