Saturday, January 20, 2018

#1 2006-01-27 05:13:47 am

jamesjohnson
Member
Registered: 2006-01-27
Posts: 4

Rotate if portrait

I'm new to Applescript, so forgive me for any dumbness...

I am trying to write an Automator script to rotate an image to the right if it is portrait, so I can batch process images for viewing on a PSP. In my main.applescript I have the following:

Applescript:

on run {input, parameters}
   
   set this_file to item
   try
       tell application "Image Capture Scripting"
           set this_image to open this_file
           set the image_width to the width of this_image
           set the image_height to the height of this_image
           if the image_width is greater than the image_height then
               rotate this_image to angle -90
               save this_image in this_file
           end if
           close this_image
       end tell
   end try
   --    return input
end run

My questions:

1) how do I do this for all items in the input
2) why do I get an error "main.applescript:16: Expected end of line but found identifier"
(I believe this refers to the line

Applescript:

rotate this_image to angle -90

Thanks for any help you can give.


Filed under: image

Offline

 

#2 2006-01-27 10:25:41 am

jamesjohnson
Member
Registered: 2006-01-27
Posts: 4

Re: Rotate if portrait

Thanks! I based the script off one in the Apple support area, but I guess it must have been old.

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)