4 Replies Latest reply on Dec 10, 2010 4:46 AM by Muppet Mark-QAl63s

    [ActionScript] Error closing file

    JohnDevlon

      Hi,

       

       

      Can anyone please help me?

       

      I'm trying to create my own actionscript droplet that process multiple images in Photoshop. For some reason, I'm not able to close the files...

       

      The code

       

      on open FileList

       

       

       

      repeat with ThisFile in FileList

       

               tell application "Adobe Photoshop CS5"

       

                  open ThisFile

                      --my processImage(DropItem)

       

                  close ThisFile saving yes

       

       

       

       

               end tell

       

      end repeat

       

       

       

      end open

       

       

      A message appears "alias of "Macintosh HD:Files: ..." of application "Adobe Photoshop CS5" can not be requested " (or something like that) when trying to close the file...

       

      Thanx

       

      John

        • 1. Re: [ActionScript] Error closing file
          Muppet Mark-QAl63s Level 4

          John, your code is AppleScript… don't know if you can edit a post title? ActionScript is a Flash thing I think… I don't have CS5 so I can't help with your code but Photoshop does allow you to create droplets from actions that work very much in the same way… Does your script do something that an action just can't cut?

          • 2. Re: [ActionScript] Error closing file
            JohnDevlon Level 1

            Hi Mark,

             

            I'm sorry for the mistake. Your right. It is Applescript. Unfortunately, I'm not able to change the title anymore.

             

            Currently, I'm have a huge problem with a great number of images that contain orientation information from camera's which have a orientation sensor. These camera's write the orientation of the image in the EXIF part of the image. The problem is that the pictures are not really rotated, but only contain a rotation flag. New versions of Adobe Photoshop apply the rotation flag when opening the image, older versions ignore the rotation flag. To make a long story short: it's a known issue of which a lot of information is available on the Adobe Photoshop forums. Because the new Adobe Photoshop versions doesn't have a option to ignore the rotation flag when opening a Image, I would like to remove the rotation flag using Applescript.

            • 3. Re: [ActionScript] Error closing file
              Paul Riggott Level 6

              It isn't Applescript, but you could do this in Bridge. Here is an example of code to do it..

               

              #target Bridge
              //Run code from ESTK
              var thumbs = app.document.selections; 
               if(thumbs.length != 0){
                for(var i = 0;i < thumbs.length;i++){
                 if(thumbs[i].spec instanceof File){
                  var thumb = thumbs[i];
                  var md = thumbs[i].synchronousMetadata; 
                  md.namespace = "http://ns.adobe.com/tiff/1.0/";
                  var orientation = md.Orientation;
                              if(orientation != 'Normal') md.Orientation =1;
                              }
                          }
                      }
              
              • 4. Re: [ActionScript] Error closing file
                Muppet Mark-QAl63s Level 4

                IMO for metadata stuff you are better of to go in the direction of using Bridge (as Paul's example) or EXIF tools… I would not be wanting to open/resave files in Photoshop just for this. There were problems with AppleScript & CS5's (Photoshop) that I have NOT had to deal with since I switched to ESTK some time before it's release… So I would NOT be of any help with that anyhow. Was this all that your droplet did? What was in your handler call?