Skip to main content
Known Participant
April 15, 2016
Question

?how to export file name & date created as text?

  • April 15, 2016
  • 4 replies
  • 1518 views

(to speed up copyright registration workflow)

I am registering batches of images.

I need file name followed by date created, e.g.,

0304d, Jan 31, 2003 (or 1/31/2003 or 1/31/03)

0305d, Jan 31, 2003

etc etc etc

0556d, May 26, 2003

etc etc etc

Want to avoid time-consuming manually

typing whilst looking at data in

Bridge or CS6 ACR...

Advice appreciated!!  Thanks in advance.

This topic has been closed for replies.

4 replies

MR74270
Inspiring
April 27, 2016

Hi all,

For a job like this I prefer use the Excel CSV format than a simple text file. The advantage is interesting : you will be able to sort your files either by their names, or by their creation date.

In the following example we have to find the code number 36867 of the Exif "date" ; it doesn't depend on the user's camera (of course, this is possible only with formats that have EXIFs infos like Jpg, Tif, Psd. This script registers in an Excel file all the photos found in a tree (top folder). It is not difficult to adapt.

// ******************************** Michel Rohan *****************************************************

// MAC Finder ou WINDOWS Explorer, on autorise le double clic  et on fait passer Photoshop au 1er plan

#target photoshop

app.bringToFront();

unitRuler =    app.preferences.rulerUnits;

unitType = app.preferences.typeUnits;

var inputFolder = Folder.selectDialog("Select the top folder in which are the directories where the images are : ");

if (inputFolder != null)

{

    filesArray = scanFolder(inputFolder);

}

// Tries to open a photo

if (filesArray.length == 0)

{

    alert('There is no image in this folder. NOP')

}

else

// The script is launched

{

    app.preferences.rulerUnits = Units.PIXELS;

    app.preferences.typeUnits = TypeUnits.PIXELS;       

    var outputFolder = Folder(inputFolder + "/Excel");

    if (!outputFolder.exists) outputFolder.create();

    app.displayDialogs = DialogModes.NO;

    var linesArray = new Array();

    main();

}

// Main program

function main() 

    try {

        for (var i=0;i<filesArray.length;i++)

        {

            var docRef = filesArray;

            app.open (docRef);

            var docName  = docRef.name;

            var nbExifs = app.activeDocument.info.exif.length;

            for (var j = 0; j < nbExifs; j++)

            {

                if (app.activeDocument.info.exif[2]==36867)

                {

                    var exifDate = app.activeDocument.info.exif[1];

                    var line = docName + '  ;  ' + exifDate;

                    linesArray.push(line);

                }

            }

            app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

        }

    }

   

    catch(gestError)

    {

        alert(gestError+gestError.description);

    }   

}

writeFile();

alert('Done ! your textFile is in the folder \"../Excel\"');

app.preferences.rulerUnits = unitRuler;

app.preferences.typeUnits = unitType;

// Recursive function

function scanFolder(dossier) {

    var listeFichiers = [],

    fileList = dossier.getFiles(),i, fichier;

   

    for (i = 0; i < fileList.length; i++) {

        fichier = fileList;

        if (fichier instanceof Folder) {

            listeFichiers = listeFichiers.concat(scanFolder(fichier));

        }

        else if (fichier instanceof File && fichier.name.match(/\.(psd|jpg|tif|)$/i)) {

            listeFichiers.push(fichier);

        }

    }

    return listeFichiers;

}

function writeFile()

{

    var saveFile = new File(outputFolder+'/fileList.csv');

    saveFile.open('w');

    for (i = 0; i < linesArray.length; i++)

    {

        saveFile.encoding = "UTF8";

        saveFile.writeln(decodeURI(linesArray));

    }

    saveFile.close();

}

.

JJMack
Community Expert
Community Expert
April 16, 2016

If your using digital camera images the data you want may be in the files metadata and file name.  You could use a script. that you downloaded from the web like my stampexif script. That I wrote to be used in actions. It is included in my crafting actions package.

Crafting Actions Package UPDATED Aug 10, 2014 Added Conditional Action steps to Action Palette Tips.
Contains

Example
Download

JJMack
Stephen Marsh
Community Expert
Community Expert
April 15, 2016

There are Adobe Bridge Scripts:

extracting bridge metadata

Scripts | Image Metadata to CSV File.

http://www.ps-bridge-scripts.talktalk.net

And of course, there is always ExifTool

exiftool -csv -r -System:FileName -ExifIFD:CreateDate -IPTC:DateCreated -IPTC:TimeCreated -XMP-xmp:CreateDate -XMP-photoshop:DateCreated 'mac-os-platform/specific/path/to/file/or/top-level-folder' > '/Users/currentuser/Desktop/meta out.csv'

If you are using Win OS just swap ' for " and make sure that you have the correct file path, current logged in user name etc.

Chuck Uebele
Community Expert
Community Expert
April 15, 2016

What format do you want the text file to be? Just plain text, xml, csv, etc? This can easiely be done with scripting. Moving post to scripting forum.

Known Participant
April 15, 2016

Thanks for response!

Plain text OK.
Or easiest.

I know nothing about scripting.

Can I apply an existing script that

will spit out (file names + dates created)

into a Word or other doc.?

Where is that script & what are

steps to make it act?  Thanks!