What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Reply to thread

You could try this...

[code]

#target photoshop;

app.displayDialogs = DialogModes.NO;

var topLevel = Folder.selectDialog("Please select top level folder");

if(topLevel != null ){

var folders =[];

folders = FindAllFolders(topLevel, folders);

folders.unshift(topLevel);

for(var z in folders){

Files = folders[z].getFiles("*.jpg");

createPresentation(folders[z]);

Files=[];

    }

}

function createPresentation(Dir){   

    var d = new ActionDescriptor(); 

    var list = new ActionList();  

    for(var a=0;a<Files.length;a++) list.putPath(Files[a]);     

    d.putList(stringIDToTypeID("filesList"), list);     

    d.putPath(stringIDToTypeID("to"), new File(Dir + "/" + decodeURI(Dir.name) + ".pdf"));    

    d.putBoolean(stringIDToTypeID("includeAnnotations"), true);  

    d.putEnumerated(stringIDToTypeID("backgroundColor"), stringIDToTypeID("backgroundColor"), stringIDToTypeID("white")); 

    d.putBoolean(stringIDToTypeID("autoAdvance"), true); 

    d.putInteger(stringIDToTypeID("autoAdvanceSeconds"), 5); 

    d.putBoolean(stringIDToTypeID("loop"), true); 

    d.putEnumerated(stringIDToTypeID("transition"), stringIDToTypeID("transition"), stringIDToTypeID("random")); 

    d.putBoolean(stringIDToTypeID("presentation"), true); 

    var d1 = new ActionDescriptor(); 

    d1.putString(stringIDToTypeID("pdfPresetFilename"), "High Quality Print"); 

    d1.putBoolean(stringIDToTypeID("pdfPreserveEditing"), true); 

    d1.putBoolean(stringIDToTypeID("pdfViewAfterSave"), false); 

    d1.putInteger(stringIDToTypeID("pdfCompressionType"), 7); 

    d.putObject(stringIDToTypeID("as"), stringIDToTypeID("photoshopPDFFormat"), d1); 

    executeAction(stringIDToTypeID("PDFExport"), d, DialogModes.NO);

};

function FindAllFolders( srcFolderStr, destArray) {

    var fileFolderArray = Folder( srcFolderStr ).getFiles();

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

        var fileFoldObj = fileFolderArray[i];

        if ( fileFoldObj instanceof File ) {           

        } else {

         destArray.push( Folder(fileFoldObj) );

        FindAllFolders( fileFoldObj.toString(), destArray );

        }

    }

    return destArray;

}

[/code]


What is our favorite program/app? (Hint - it begins and ends with the letter P)
Back
Top