Back

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

Forum Replies Created

Viewing 15 posts - 136 through 150 (of 344 total)
  • Author
    Posts
  • in reply to: Scripts for Table Header and Footer #85627
    Ari Singer
    Member

    This should convert all your tables’ last rows to footer rows:

    app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Process Table");
    function main(){
        allTables = app.activeDocument.stories.everyItem().tables.everyItem().getElements();
        for (aTable=0; aTable<allTables.length; aTable++)
        allTables[aTable].rows[-1].rowType = RowTypes.FOOTER_ROW;
        }
    
    in reply to: Style Sheets Based on… #85503
    Ari Singer
    Member

    I’m almost sure there’s a ready script just for what you need, but can’t remember the name. Do a search on the site and you should find it.

    in reply to: Table help needed #85474
    Ari Singer
    Member

    You can upload a picture to any image-hosting website (such as imgur.com or dropbox.com) and post the link here.

    in reply to: Grep code works inside indesign but not in script #85416
    Ari Singer
    Member

    I think I’ve made a mistake when implying that when using an escaped backslash in a script you need three backslashes not four. As it turns out in my recent experience you actually do need four! And three results in an error.

    in reply to: Creating a book from a Word manuscript #85370
    Ari Singer
    Member

    Do a GREP Find/Change with the following settings:

    Find What: \r\r

    Change To: \r

    Hit “Change All”.

    This basically finds any instance of two carriage returns one after the other, and replaces it with just one.

    in reply to: Export In-Design to PDF #85343
    Ari Singer
    Member

    When you try to override, do you get a pop-up asking you to confirm the override?

    in reply to: Grep code works inside indesign but not in script #85311
    Ari Singer
    Member

    Whenever you include a backlash within quotes in a script, the script will get confused. For example, if you write: findWhat: "\r" JavaScript will think that you want to insert an actual return in that string (because that’s the way it’s done in JavaScript). So whenever you include a GREP query in a script, any backslashes have to be escaped again. So instead of \r it has to be r.

    In other words, for every backslash: one more. (except when you already have two backslashes, such as when you’re searching for an actual backslash, then you have to write three backslashes, not four.

    So in your case, that would be like this:

    {findWhat:”(s)(d+.d+)(,s)(d+.d+)(,s)(d+.d+)(,s)(d+.d+)(s)”} {changeTo:”t$2t$4t$6t$8t”} {}

    in reply to: Delete Empty (Anchor) frames #85291
    Ari Singer
    Member

    Okay, now I understand. But what constitutes an ’empty’ graphic frame? When is considered to be empty?

    in reply to: Delete Empty (Anchor) frames #85282
    Ari Singer
    Member

    I tried using the code from Harbs that you provided, and it’s working fine by me even for frames that are anchored in tables. Maybe I misunderstood your question. Help me out…

    in reply to: TOC issues #85277
    Ari Singer
    Member

    Until you figure it out (if it’s possible, because I’m afraid this how a TOC works) you can try to use the following GREP Find/Search to fix it:

    Find What: (.+)(\r)(\d+?)(.+)

    Change To:$3$4, $1

    What it says is this: “Find any amount of text, followed by a carriage return. Then the next line starts with a digit or more, followed by a tab, then any amount of text”. It then changes around the order of things, removes a return and adds a comma.

    Ari Singer
    Member

    Try this: In document ‘b’ select the frame that holds the placed ‘a’ file, and give it the color Paper (or any color that you wish). This will place the color behind the graphic, and will effectively block the background from ‘b’ to show through.

    in reply to: Delete Empty (Anchor) frames #85241
    Ari Singer
    Member

    Yes, I realized it just after I posted the script. It’s not fully baked yet…

    in reply to: Delete Empty (Anchor) frames #85239
    Ari Singer
    Member

    Try this out:

    //Ari S. - designerjoe@outlook.com
    // Delete empty anchored frames
    app.scriptPreferences.enableRedraw = false;
    app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Delete Empty Anchored Frames");
    function main(){
        var myDoc = app.activeDocument;
        app.findChangeGrepOptions.includeLockedLayersForFind = false;
        app.findChangeGrepOptions.includeLockedStoriesForFind = false;
        app.findChangeGrepOptions.includeHiddenLayers = false;
        app.findChangeGrepOptions.includeMasterPages = false;
        app.findChangeGrepOptions.includeFootnotes = true;
        app.findGrepPreferences = app.changeGrepPreferences = null;
        app.findGrepPreferences.findWhat = "~a";
        var myFound = myDoc.findGrep(true);
        for (i = (myFound.length - 1); i >= 0; i--){
            var myAnchorPosition = myFound[i];
            if (myAnchorPosition.texts[0].pageItems[0].contents == ""){
                myAnchorPosition.texts[0].pageItems[0].remove();
                }
            }
        }
    
    in reply to: Sort a Book? #85232
    Ari Singer
    Member

    You’re right.

    in reply to: Sort a Book? #85227
    Ari Singer
    Member

    One more thing, this script will not work if the Page Numbering View settings (found in the General pane of the InDesign preferences) is set to “Absolute Numbering”.

    But it’s probably not an issue anyway because the default is “Section Numbering”.

Viewing 15 posts - 136 through 150 (of 344 total)