Back

If your email is not recognized and you believe it should be, please contact us.

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Export pages to jpg with custom filenames #72651

    I had thought the same idea about running script/action in PhotoShop post making the jpegs, so I think that’s the answer!
    Thanks for your help (and the initial script too!)

    in reply to: Export pages to jpg with custom filenames #72624

    Hi,
    Thanks for the posts above, I am a novice in creating scripts and am trying to amend the script so that I can use it to export the files as pngs rather than jpegs. Below is the script I have so far, but it doesn’t seem to save any files. I don’t get an error message however. Any ideas?
    Thanks very much in advance!

    if (app.documents.length != 0){
    var myDoc = app.activeDocument;
    MakePNG_FORMATfile();
    } else {
    alert(“Please open a document and try again.”);
    }
    function myPS() {
    try {
    return myDoc.selection[0].appliedParagraphStyle;
    } catch (e) {
    alert(“Place cursor to text with paragraph style for filenames”);
    exit();
    }
    }
    function MakePNG_FORMATfile() {
    app.pngExportPreferences.pngQuality = PNGQualityEnum.MAXIMUM;
    app.pngExportPreferences.exportResolution = 72;
    app.pngExportPreferences.pngExportRange = ExportRangeOrAllPages.exportRange;
    app.findGrepPreferences = null;
    app.findGrepPreferences.appliedParagraphStyle = myPS();

    var f = myDoc.findGrep();

    for (var myCounter = 0; myCounter < f.length; myCounter++) {
    try {
    var curPage = f[myCounter].parentTextFrames[0].parentPage;
    if (curPage.appliedSection.name != “”) {
    curPage.appliedSection.name = “”;
    }
    var objName = f[myCounter].contents.replace(/ /g,”_”).toLowerCase();
    app.png_formatExportPreferences.pageString = curPage.name;
    var myFilePath = myDoc.filePath + “/” + objName + “.png”; //export to a folder of the current document
    var myFile = new File(myFilePath);
    myDoc.exportFile(ExportFormat.png, myFile, false);
    } catch(e) {
    //pasteboard?
    }
    }
    }

Viewing 2 posts - 1 through 2 (of 2 total)