7 Replies Latest reply on May 27, 2011 9:14 AM by Muppet Mark-QAl63s

    Printing from Photoshop using AppleScript

    mnp13 Level 1

      I am working on a project that will automatically print an image that is moved to a folder.

       

      Right now, I have the following working: the image from my camera saves to a folder on my desktop, then applescript opens the image in Photoshop and runs an action on it that resizes it, crops it, and then re-saves it into a different folder. Here's where my problem starts...

       

      My printer - an Epson R800 - does not have a default paper size of 5x7 borderless. That selection has to be made in Photoshop, however, Photoshop actions will not capture paper settings. (Which I think is sooooo stupid, but that's another issue.)

       

      When the image is dropped in the second folder, it currently automatically prints, but on "letter" size paper.

       

      I need to script the following:

       

      Tell Photoshop CS4 to open the image (well, I can do that), but then select the correct paper size (5x7 borderless), and print. I've tried a few different things and they aren't working.

       

      Any help would be appreciated!

       

      Thanks,

       

      Michelle

        • 1. Re: Printing from Photoshop using AppleScript
          Muppet Mark-QAl63s Level 4

          Do you only have Photoshop? If you have the suite then placing and printing from Indesign would be my preferred route… You would just have a saved print preset handle all the options… As far as Im aware printing with Photoshop does not record with actions or the scriptlistener plug-in… So GUI scripting it would be your only option… PITA to do and not very reliable…

          • 2. Re: Printing from Photoshop using AppleScript
            mnp13 Level 1

            Yes, I have the full CS4 compliment.

             

            I don't think I've ever used InDesign actually, does it have actions like Photoshop does? Or how do I set up a "saved set" of presets?

             

            I'll still have to script it from AppleScript to open and run something, as camera-to-output needs to be 100% automated.

            • 3. Re: Printing from Photoshop using AppleScript
              Muppet Mark-QAl63s Level 4

              Indesign is a page layout application… But as your page only requires the one rectangle to place an image in it should not be too difficult for you. Set up a print options with all your printer specific requirements save it then this can be called by script in the future… Makes things much simpler…

              • 4. Re: Printing from Photoshop using AppleScript
                mnp13 Level 1

                I'll give that a try when I get home.

                 

                Is InDesign the "new" PageMaker? I used to work in digital pre-press, and we used quark for making the impositions for books. If it's anything like Quark or Pagemaker, I should be ok with it!

                 

                Thanks!

                • 5. Re: Printing from Photoshop using AppleScript
                  Muppet Mark-QAl63s Level 4

                  Yes, if you are used to working with either of those other apps then Indesign will pose no problem to you at all… Its better than both of them too… not so 'new' thou now… I started to learn script with Quark & AppleScript… BTW you may even decide to leave out the image process altogether as you could crop and scale within the rectangle/frame unless there is something else your using Photoshop for…

                  • 6. Re: Printing from Photoshop using AppleScript
                    mnp13 Level 1

                    Ok, I can't figure out the scripting for InDesign.

                     

                    I made a printer preset, so I have that taken care of, but I can't figure out how to get a new document to open and then put in the .jpg file then print.

                     

                    If you can give me some pointers I'll keep working at it, but I'm stuck right now.

                    • 7. Re: Printing from Photoshop using AppleScript
                      Muppet Mark-QAl63s Level 4

                      Here is a starter that is working just fine at work where I have access to CS2 and printers…

                       

                       

                      -- A path to an image file as text

                      set PrintImage to (path to desktop as text) & "HE2015.tif"

                      --

                      tell application "Adobe InDesign CS2"

                      activate

                      -- Turn off the app dialogs

                      tell script preferences

                      set user interaction level to never interact

                      end tell

                      -- Get the new document preset

                      set DocPreset to document preset "A4-P" -- Change here

                      -- Make our new doc

                      set PrintDoc to make new document at beginning ¬

                      with properties {document preset:DocPreset}

                      -- Get the printer preset

                      set PrintPreset to printer preset "Xerox A3-P-SEF" -- Ditto Here

                      tell PrintDoc

                      set DocWidth to page width of DocPreset

                      set DocHeight to page height of DocPreset

                      -- Add a rectangle to hold the image

                      set ImageFrame to make new rectangle at beginning ¬

                      with properties {geometric bounds:{0, 0, DocHeight, DocWidth}}

                      tell ImageFrame

                      -- Put our image in the rectangle

                      place PrintImage as alias

                      -- Fit our image to fill box keeping proportions

                      tell image 1

                      fit given fill proportionally

                      fit given center content

                      end tell

                      end tell

                      print using PrintPreset without print dialog

                      end tell

                      end tell

                       

                       

                      There are two strings that you will need to change one for a 'new document preset' and the second for a 'print preset'…

                      The example just uses an image off my desktop to test with… Any problems post in the Indesign forum as this no longer belongs here…