Back

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

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 47 total)
  • Author
    Posts
  • in reply to: Align to column guides #14331866
    Brian Pifer
    Participant

    Hi V S,

    Sorry for the delay here, but give this a shot, and let me know what you think: https://www.designtimesolutions.com/#scripts

    It gives you the choice to snap to nearest left or right column guide, margin edge, or page edge. It looks for guides that the selections don’t overlap with.

    in reply to: Script to Automate Image Export Renaming #1247912
    Brian Pifer
    Participant

    Just saw your followup, and can’t edit my original message for some reason. But feel free to contact me through my site if you have further needs. Glad you were able to figure out how to adapt it for the undergrads. Stay safe!

    in reply to: Script to Automate Image Export Renaming #1247902
    Brian Pifer
    Participant

    Hi Billy,

    Shoot me a message through the form at the bottom of my homepage at http://www.designtimesolutions.com and we can take this offline. Thanks!

    in reply to: Script to Automate Image Export Renaming #1241117
    Brian Pifer
    Participant

    Brilliant. If you are so inclined and able, please feel free to donate to a charity of your choice focused on Covid-19 relief.

    in reply to: Script to Automate Image Export Renaming #1241097
    Brian Pifer
    Participant

    Yeah, Desktop could have been the issue. Here’s a revamp to let you select the folder to save to, and to also find by the “Portrait” object style. If this doesn’t work, let me know what the syntax error msg says.

    app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.EXPORT_RANGE;
    app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.HIGH;
    var pages = app.activeDocument.pages;
    var fol = Folder.selectDialog(“Choose a folder”);
    for (var i = 0; i < pages.length; i++) {
    var graphics = pages[i].pageItems;
    for (var j = 0; j < graphics.length; j++) {
    if (graphics[j].appliedObjectStyle.name == “Portrait”) {
    if (graphics[j].graphics[0].itemLink.isValid) {
    var fileToExport = File(fol.fsName + “/” + graphics[j].graphics[0].itemLink.name);
    app.jpegExportPreferences.pageString = (pages[i].documentOffset + 1).toString();
    app.activeDocument.exportFile(ExportFormat.jpg, fileToExport, false);
    break;
    }
    }
    }
    }

    in reply to: Script to Automate Image Export Renaming #1240767
    Brian Pifer
    Participant

    For the kids. This will write all the pages to your desktop. It assumes all the images that you are placing and exporting are jpegs, and that there is one linked item per page. It will export a high quality jpeg as the same name as the linked image name. Note that if the linked images are also on the desktop, it will overwrite them. Copy the text below into a plain text editor, and save it with the .jsx extension, then copy that file to your scripts folder. Run it on your open document.

    app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.EXPORT_RANGE;
    app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.HIGH;
    var pages = app.activeDocument.pages;
    for (var i = 0; i < pages.length; i++) {
    var graphics = pages[i].allGraphics;
    for (var j = 0; j < graphics.length; j++) {
    if (graphics[j].itemLink.isValid) {
    var fileToExport = File(“~/Desktop/” + graphics[j].itemLink.name);
    app.jpegExportPreferences.pageString = (pages[i].documentOffset + 1).toString();
    app.activeDocument.exportFile(ExportFormat.jpg, fileToExport, false);
    break;
    }
    }
    }

    in reply to: Exact size Image frame dimensions script #1240708
    Brian Pifer
    Participant

    Correct, just something to started on the UI. From there, it would be a matter of resizing the rectangles and their containing images.

    app.selection returns an array of all the selected objects on a page. If you select a frame with your black arrow tool, that’s a rectangle object. With one object selected:

    var rect = app.selection[0];
    var containingImage = rect.graphics[0];

    You can look at the rect.geometricBounds property, as well as rect.resize() and rect.fit() methods. Lots of different ways to skin the cat based on your ultimate needs and how your doc is set up.

    For some guidance on the Rectangle object, https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Rectangle.html

    in reply to: Exact size Image frame dimensions script #1240428
    Brian Pifer
    Participant

    Here’s the dialog built with the handy scriptUI builder: https://scriptui.joonas.me/

    Should help you get started.

    // DIALOG
    // ======
    var dialog = new Window(“dialog”);
    dialog.text = “TableStyler”;
    dialog.orientation = “column”;
    dialog.alignChildren = [“left”,”top”];
    dialog.spacing = 10;
    dialog.margins = 16;

    // GROUP1
    // ======
    var group1 = dialog.add(“group”, undefined, {name: “group1”});
    group1.orientation = “column”;
    group1.alignChildren = [“left”,”center”];
    group1.spacing = 10;
    group1.margins = 0;

    var radiobutton1 = group1.add(“radiobutton”, undefined, undefined, {name: “radiobutton1”});
    radiobutton1.text = “Height”;

    var radiobutton2 = group1.add(“radiobutton”, undefined, undefined, {name: “radiobutton2”});
    radiobutton2.text = “Width”;

    // GROUP2
    // ======
    var group2 = dialog.add(“group”, undefined, {name: “group2”});
    group2.orientation = “row”;
    group2.alignChildren = [“left”,”center”];
    group2.spacing = 10;
    group2.margins = 0;

    var edittext1 = group2.add(‘edittext {properties: {name: “edittext1”}}’);
    edittext1.text = “Enter the width or height to set”;

    // GROUP3
    // ======
    var group3 = dialog.add(“group”, undefined, {name: “group3”});
    group3.orientation = “row”;
    group3.alignChildren = [“left”,”center”];
    group3.spacing = 10;
    group3.margins = 0;

    var button1 = group3.add(“button”, undefined, undefined, {name: “button1”});
    button1.text = “OK”;

    var button2 = group3.add(“button”, undefined, undefined, {name: “button2”});
    button2.text = “Cancel”;

    dialog.show();

    in reply to: #1236494
    Brian Pifer
    Participant

    page.appliedMaster = NothingEnum.NOTHING;

    in reply to: Open All Files one by one #12300435
    Brian Pifer
    Participant

    Use the Folder object:

    var fol = Folder(“some/path”);
    var inddFiles = fol.getFiles(“*.indd”);
    for (var i = 0; i < inddFiles.length; i++) {
    var doc = app.open(inddFiles[i]);
    //do stuff
    }

    in reply to: FindChangeByList text files on shared drive? #12432975
    Brian Pifer
    Participant

    My pleasure. Yes, if that’s the only place that function was called, then it’s fine to remove entirely.

    Brian Pifer
    Participant

    Make sure whatever is inside quotation marks (“b”) on the following line is an actual named Object Style in your document:

    var oStyle = app.activeDocument.objectStyles.itemByName(“b”);

    An example of the change would be:

    var oStyle = app.activeDocument.objectStyles.itemByName(“myNamedStyle”);

    in reply to: FindChangeByList text files on shared drive? #12243955
    Brian Pifer
    Participant

    Leave line 113 as: var myFindChangeFile = myFindFile(“/FindChangeSupport/FindChangeListNAME1.txt”)

    Then change the myFindFileFunction beginning around line 192 to:

    function myFindFile(myFilePath){
    var folderPath = “F:/Production/5. Tools/1. Scripts”;
    myFilePath = folderPath + myFilePath;
    if(File(myFilePath).exists == false){
    //Display a dialog.
    myFilePath = File.openDialog(“Choose the file containing your find/change list”);
    }
    return myFilePath;
    }

    in reply to: Data Merge Script for Multiple records #12243945
    Brian Pifer
    Participant

    I would be happy to develop something for you. Feel free to contact me at brianpifer@gmail.com for a quote.

    in reply to: Delete entire line if field is empty #14323083
    Brian Pifer
    Participant

    Just use Find/Replace after you’ve created the document?

    Find in Grep would be: Donation Amount / \$\rDate of Donation /\r

Viewing 15 posts - 1 through 15 (of 47 total)