Skip to main content
November 25, 2009
Question

Need Extendscript assistance

  • November 25, 2009
  • 1 reply
  • 3761 views

I am attempting to use Extendscript to perform the following function;

Read a folder on my hard drive i.e. c:/temp

Find all the .rw2 files imported from my lx3

Convert them to dng format for use by Adobe Bridge

For some reason, I am unable to script this to a point where the invocation of adobe~1.exe with the dngconverter commandline parameters will return true.  I have written a cmd file to iterate through the folder, where the files are found and converted successfully when done from a command line, but invoking the cmd file via the Extendscript only converts a single file, not the group.

If anyone can shed any light on this subject, or potentially provide an example of how this can be done, it would be greatly appreciated.

Thank you,

LX3FAN

This topic has been closed for replies.

1 reply

Paul Riggott
Inspiring
November 25, 2009

If you have Photoshop CS4 you can use the System command for each conversion or you could build a bat file and execute that.

Paul Riggott
Inspiring
November 25, 2009

I have just tried with the system command and that failed for some reason so tried a batch file and that worked fine, mine were cr2 file but have changed the extension to suit...

#target photoshop
function main(){
var DNG = decodeURI(app.path.parent.fsName)+"\\Adobe DNG Converter.exe";
var inputFolder = Folder.selectDialog("Please select the folder with Files to process");
if(inputFolder == null) return;
var fileList=[];
fileList = inputFolder.getFiles("*.rw2");
if(!fileList.length) return;
var DNGbat=File("~/desktop/DNGbat.bat");
DNGbat.open("w")
DNGbat.writeln("@echo off");
for (var z in fileList){
var command ='"'+DNG+ '" -c "'+decodeURI(fileList.fsName) +'"';  
command = command.replace(/\\/g,'/');
DNGbat.writeln(command);
    }
DNGbat.writeln("cls");
DNGbat.close();
DNGbat.execute();
}
main();

November 25, 2009

Paul,

     Thank you for the assistance thus far.  I'm using CS3, and my target is bridge vs. photoshop, so that I'm able to bring the dng files into camera raw.  A follow on question: Is it possible to perform the functionality desired purely with javascript (potentially with a sleep function) vs needing to use a combination of javascript and batch file commands?