5 Replies Latest reply on Mar 1, 2017 2:32 PM by JJMack

    Open another file with same name and copy path

    tJohnson Level 1

      Hi all. I have an idea for a script to speed up what is essentially a daily task for me. I can do some really simple scripting, but this is way outside of my current skills, as it would involve scripting some Finder actions as well (I think).

       

      What I'm attempting to do is this: Every day we send images out to have them outlined. In order to make the transferring of files quicker, we save the images as full size jpegs and send those out. When they come back, we take the path from the jpeg and copy it back into the original tiff or psd. I'm able to automate the copying of the path from one doc to the next, but what I would really like is to be able to open the original tif and then have the script go to a specific folder on my desktop and open the jpeg there that has the same name as the tiff that I am running the script on. I can then incorporate the copying of paths over using an action.

       

      Any help with that would be much appreciated.

       

      Regards,

      Tim

        • 1. Re: Open another file with same name and copy path
          JJMack Most Valuable Participant

          I would think  that if you are getting jpeg file back into a folder on your desktop that somehow now have have paths. I did not know jpeg file can contain paths. That you would want the script to process the jpeg file in that folder,  Open a Jpeg file, open the original tiff file that has the same name,  copy the path into the tiff document. save the tiff file, close the tiff file, close the jpeg file and move onto the next jpeg file and repeat that process. till all jpeg file have been process.  A single Photoshop script should be able to do that.

          • 2. Re: Open another file with same name and copy path
            tJohnson Level 1

            That's sort of the idea. But, it would be better if I opened the tiff that I was ready to retouch, then run the script (from within a photoshop action), to go to the jpeg folder and find the proper file to get the path from (yes, jpegs can have paths). The reason for this is just that the jpegs are always in my download folder. The tiffs are on servers in different folders for individual jobs, or even on different servers for different clients. They aren't all in any particular place each time.

            • 3. Re: Open another file with same name and copy path
              JJMack Most Valuable Participant

              I disagree. If you ran that script any Tiff you open for retouch would have its path. It would not matter where the tiff files are if when you save the original jpg the Tiff files location could stored in the Jpeg File metadata  for instance in the instructions metadata field.  The batch script would copy the path to the original Tiff file wherever that may be.

              • 4. Re: Open another file with same name and copy path
                tJohnson Level 1

                Oh, I see what you're saying. If that would work that would be great.

                • 5. Re: Open another file with same name and copy path
                  JJMack Most Valuable Participant

                  You wrote that save Jpeg Files from your Tiff document to send out to have Path added.  I assume you save them full size and resolution so when you get then back the Path will be perfect for your Tiff files.  Therefor you use Save As (Jpeg) to save those jpg files.  The jpg files will have the Tiffs Documents metadata.

                   

                  It is very easy to use the Script Event manager to set up a script Open or perhaps better a save event.  Any time you open or save a document the script will be triggered,  The script would look to see if the document has a backing file and if it does. Check if backing file is a Tiff file. If it is it would look to see it that information is in the document instruction metadata field. If it is not the script would add it to the field and re-save the tiff.  Any Jpeg file save from that document would  have the Tiff file path save in the instruction field.   The only ways it would not would be if You open a RAW file and save out the Jpeg before you save ouy the Tif file.  OR you use Save For Web to save the Jpeg file  to strip the metadata it would also not save the document resolution you do not want to do that.