6 Replies Latest reply on Dec 15, 2015 12:59 PM by Alex-CL

    Can data sets be used/called using either scripts or from a custom plugin?

    Alex-CL

      I'm working on a project using data sets and I would like to know if I can have a a script or even a plugin that firstly imports data sets and then exports those data sets as files. It seems to me like something that would be possible but I'm yet to find a plugin or script that uses data sets so I thought I'd come and ask.

       

      I'm a web developer and work in photography at the minute so we'll have to commission this if it's possible, so any information on where you can find plugin developers looking for work (UK based ideally) would be very welcome too.


      Thanks

        • 1. Re: Can data sets be used/called using either scripts or from a custom plugin?
          Silver Back Gorilla Level 1

          Specifically, what do you want the Photoshop script to do with the data after it's been imported? I have created many scripts that  import csv file data and that is easy to do. I'm sure other file types would be easy to import as well but I've just always used plain old csv files. 

          • 2. Re: Can data sets be used/called using either scripts or from a custom plugin?
            Silver Back Gorilla Level 1

            This script will open a file dialog to import a csv.  It will then put it into a 2 dimensional array.

             

            var csvFile = File.openDialog("Open CSV File","comma-delimited(*.csv):*.csv;"); 

            textArray=[];

            csvToArray(csvFile,textArray);

             

            function csvToArray(file,array){

            var i=0;

            file.open('r') ;

            while (!file.eof){

            array[i]=file.readln().split(',');

            i++;

            }

            file.close();

            }

            • 3. Re: Can data sets be used/called using either scripts or from a custom plugin?
              Alex-CL Level 1

              Hi, and thanks for your reply.

              Primarily, I just wanted to know that it can be done but I'll explain what I'm after. It's very basic but will save hours and hours of my time.

               

              At the minute I open a .PSD file (I'll refer to them as templates) which has layers and variables defined for them. I then import data sets from a file and then I go 'File>Export>Export Data Sets as Files' ..then wait 30minutes and do it again for the next template ... and the next template .. and the next ... you get the idea. What I want is to create a plugin or script which does this all for me. Simply by selecting the directory containing the templates the script/plugin opens each template in turn, imports the data sets and then exports the files for me. The templates, data set files and destination directories needed are all going to be named predictably so that the plugin/script can actually use file names if needed and they will all be kept relative in location to the templates.

               

              All of these tasks are very basic PS features I just want something to string them all together for me and log/bypass/skip any dialogue boxes that pop-up in the process.

               

              I would appreciate any help either creating this or information on where I could find developers who could.

               

              Thanks again

              • 4. Re: Can data sets be used/called using either scripts or from a custom plugin?
                Alex-CL Level 1

                Hi, and thanks for your reply.

                 

                Primarily, I just wanted to know that it can be done but I'll explain what I'm after. It's very basic but will save hours and hours of my time.

                 

                At the minute I open a .PSD file (I'll refer to them as templates) which has layers and variables defined for them. I then import data sets from a file and then I go 'File>Export>Export Data Sets as Files' ..then wait 30minutes and do it again for the next template ... and the next template .. and the next ... you get the idea. What I want is to create a plugin or script which does this all for me. Simply by selecting the directory containing the templates the script/plugin opens each template in turn, imports the data sets and then exports the files for me. The templates, data set files and destination directories needed are all going to be named predictably so that the plugin/script can actually use file names if needed and they will all be kept relative in location to the templates.

                 

                All of these tasks are very basic PS features I just want something to string them all together for me and log/bypass/skip any dialogue boxes that pop-up in the process.

                 

                I would appreciate any help either creating this or information on where I could find developers who could.

                 

                Thanks again

                • 5. Re: Can data sets be used/called using either scripts or from a custom plugin?
                  Silver Back Gorilla Level 1

                  OK, I now understand what you are referring to.  I was just thinking generic spreadsheet type data importing.  You are referring to the Photoshop image data sets and variables.  I have never scripted those but it's probably pretty simple to do. I just did a quick test and exported a data set.  This was recorded by the Script Listener plugin. Therefore, it should be possible to at least do it that way.  It may be possible through the DOM as well, not sure.  However, the script listener combined with some other coding to select the right data set names would be a quick and dirty method to accomplish it.  You may be able to do the batch processing with Image Processor and using an action.  The action could be recorded to run any needed scripts.  I do a lot of processing with action and run small scripts in an action set when it needs to use some logic.

                   

                  Anyway, I'm not in the UK.  Hopefully you can find someone in the UK to work with.  If not, I may be able to help you from across the Atlantic.  However, I am booked for at least the next week or so.  I'm still working to get all of my programs aligned to the new CC 2015.1 changes.

                  • 6. Re: Can data sets be used/called using either scripts or from a custom plugin?
                    Alex-CL Level 1

                    Thanks again, good to know that it may be possible. Yeh, definitely, I'm mainly looking for someone over here so that I can talk to them, I'm sure we could speak over the phone/skype though if you were happy to take this on failing to find someone over here.

                     

                    I'll speak to my colleagues tomorrow and get back to you on this but I appreciate the time you've taken reply.