Back

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

Forum Replies Created

Viewing 15 posts - 151 through 165 (of 344 total)
  • Author
    Posts
  • in reply to: Sort a Book? #85226
    Ari Singer
    Member

    Peter, I’m afraid you left out the closing parentheses, as well as the immediate call to invoke it.

    I fixed it for you:

    (function () {
      var list = [];
      var docs = app.books[0].bookContents;
      for (var i = 0; i < docs.length; i++) {
        list.push ({name: docs[i].name, firstPage: Number(docs[i].documentPageRange.replace(/-\d+/,''))});
      }
    
      list.sort (function (a,b) {return a.firstPage - b.firstPage})
    
      for (i = list.length-1; i >= 0; i--) {
        docs.item(list[i].name).move (LocationOptions.AT_BEGINNING);
      }
    })()
    

    Ari

    in reply to: Remove character at the end of a line of wrapped text #85222
    Ari Singer
    Member

    Sorry, just noticed a flaw in my code. I wrote a single ‘=’ instead of ‘==’. So here’s the fixed code:

    if ((lines[j].characters[-1].contents == SpecialCharacters.DISCRETIONARY_LINE_BREAK) && (lines[j].characters[-2].contents == ",")) {
    lines[j].characters[-2].appliedCharacterStyle = 'Hide';

    Unfortunately, for whatever reason, I can’t always edit my posts :(

    in reply to: Easier way using InDesign for catalogus / magazine? #85220
    Ari Singer
    Member

    He meant to ask if you’re using different layers for each language, not different InDesign files

    in reply to: Remove character at the end of a line of wrapped text #85219
    Ari Singer
    Member

    You’re absolutely right, but Peter didn’t care about that because in this situation he knew there will only be discretionary line breaks after a comma. So he didn’t bother. But in the real world if there was such a case then that line will be written as such:

    if ((lines[j].characters[-1].contents == SpecialCharacters.DISCRETIONARY_LINE_BREAK) && (lines[j].characters[-2].contents = ",")) {
            lines[j].characters[-2].appliedCharacterStyle = 'Hide';
    

    Which basically says: If the last character is a discretionary line break and there is a comma before that, then…

    Ari Singer
    Member

    Here you go. This is the updated script that removes the clipping path from the bottom object:

    //Ari S. - designerjoe@outlook.com
    app.scriptPreferences.enableRedraw = false;
    // 'Undo' will undo the entire script
    app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Image Manipulation Script");
    
    function main(){
        // Capture the current selections in array
        var mySelections = app.selection;
        for (var i = 0; i < mySelections.length; i++) {
            try{
                var bottomObject = mySelections[i];
                var topObject = bottomObject.duplicate();
                bottomObject.transparencySettings.blendingSettings.blendMode = BlendMode.MULTIPLY;
                try {
                    topObject.pageItems.item(0).clippingPath.appliedPathName = topObject.pageItems.item(0).clippingPath.photoshopPathNames[0];
                    topObject.pageItems.item(0).clippingPath.clippingType = ClippingPathType.PHOTOSHOP_PATH;
                    bottomObject.pageItems.item(0).clippingPath.clippingType = ClippingPathType.NONE;
                    try {
                        var myGroup = bottomObject.parent.groups.add ([bottomObject, topObject]);
                        app.select(myGroup);
                        }
                    catch (myError) {
                        // If it can't group
                        alert("could not group successfully");
                        }
                    }
                catch (myError) {
                    // If it can't apply the Photoshop path then it obviously does not have one
                    alert("Selected image does not have a Photoshop path applied")
                    }
                }
            catch (myError){
                // If it can't duplicate the object or apply multiply then it's obviously not a graphic frame
                alert("Make sure you selected a graphic frame");
                }
            }
        }
    

    Only one line was added:
    bottomObject.pageItems.item(0).clippingPath.clippingType = ClippingPathType.NONE;

    in reply to: Indesign Glyphs Missing #85202
    Ari Singer
    Member

    Okay, very simple. What it the glyph that’s missing?

    in reply to: Numbering Figures According to Sections #85180
    Ari Singer
    Member

    Skemicle’s idea is great, but I want to add some extra tips as well:

    First, to clarify Skemicle’s approach:

    1. Edit the ‘Section’ paragraph style. Under Bullets and Numbering, from the List Type dropdown menu select Numbers (duh!…).
    2. From the List: dropdown menu select New List. A ‘New List’ dialog box appears. Give the new list a name (such as “figure_list”). Make sure both checkboxes are activated. hit OK
    3. In the Number: textbox, you’ll probably see the default string (^#.^t). Delete the last few characters so you’re only left with ^#. This will delete the period and the tab from after the number.
    4. From the Character Style: dropdown menu select New Character Style. A new ‘Character Style’ dialog box appears. Give it a name (such as ‘hidden_numbers’). Define only two settings in the character style: Make the point size 0.1 and the character color to [None]. Hit OK. This effectively ‘hides’ the numbers from the section headers so it doesn’t actually show up in the text. Save the paragraph style.
    5. Now edit the Bullets and Numbering in the ‘Figure’ paragraph style. From the List Type: dropdown menu select the ‘figure_list’ list that you created earlier. Then make sure that the Level: is set to 2.

    That’s it! It’s basically Skemicle’s approach, but clarified. Plus, a cool trick on how to ‘hide’ numbers when you don’t want then to actually show up in the text.

    in reply to: Indesign Glyphs Missing #85178
    Ari Singer
    Member

    How do you want to replace it? By changing the font of said glyph to a different font that does have the glyph? Or do you want to change the glyph to a different glyph?

    in reply to: Create automatic table of contents with subheaders #85177
    Ari Singer
    Member

    Very easy. Follow along:

    1. Make sure that the ‘subpages’ and the ‘chapter’ text have separate paragraph styles (so that the TOC builder can find them separately).
    2. Go to Layout > Table of Contents to define your TOC. Make sure that More Options is activated. (You can find its button on the right below the Save Style button).
    3. On the right there’s a list of all the paragraph styles in your document. Select the style that you used for the chapter openings and click << Add, Then do the same for the subpages style. On the left you’ll see both styles: ‘Chapter’ will be on top (‘parent’) and ‘subpages’ will be below it, indented (‘child’).
    4. Select the parent entry (‘chapter’) on the left. On the bottom you can set up a lot of options for the ‘Chapter’ entry in the TOC (such as the paragraph style to use when displayed in the TOC, or to sort it alphabetically and more), but what concerns us is only two settings. First, make sure that Level: is set to 1. Secondly, from the Page Number dropdown menu, select No Page Number. Then select on the left the ‘subpages’ entry, give it any settings that you want, but leave the Page Number options to either After Entry or Before Entry (whichever you prefer), and make sure that the Level: is set to 2.
    5. When done, hit OK, and the TOC will be ready to be placed anywhere you wish.

    I hope this clarified things, not the other way around…

    in reply to: Locked Content Moving when Pages update #85176
    Ari Singer
    Member

    Go into the Pages panel, in the flyout menu make sure the “Allow Document Pages to Shuffle” is turned on.

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

    I might be able to write a script for that (if needed), but I first have to understand better what you’re trying to acheive. Thanks!

    in reply to: Target every other carriage return #85137
    Ari Singer
    Member

    I’m sorry please disregard my previous post! I misunderstood what you want. Here is the good code:

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

    Change To: $1 $3 $5$6 (That’s intentional spaces in there)

    Note: This will work even if you change it one by one, it does not have to be changed all at once.

    in reply to: Target every other carriage return #85136
    Ari Singer
    Member

    Try this:

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

    Change To: $1$2$3$4$5\x{0020}

    But beware, this will only work correctly if you change all at once by clicking Change All.

    in reply to: Target every other carriage return #85121
    Ari Singer
    Member

    There are a number of ways to achieve this, but it really depends on what you plan to with it after that. By that I mean: do you plan on removing, editing or adding text? Or do you want to just change some formatting?

    And just to make sure: Are you sure there is no pattern, so for ex. does every other line have something in common which each other?

    in reply to: Indesign Glyphs Missing #85118
    Ari Singer
    Member

    What’s the issue?

    You can’t create a PDF because a glyph is missing? And you want to be able to change all the missing glyphs at once with a glyph that is found?

Viewing 15 posts - 151 through 165 (of 344 total)