Back

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

Forum Replies Created

Viewing 15 posts - 106 through 120 (of 340 total)
  • Author
    Posts
  • in reply to: Footnote Special Character / Marker #114241
    Peter Kahrel
    Participant

    So you want to insert the footnote number. But InDesign adds that when you create the footnote.

    in reply to: Footnote Special Character / Marker #114235
    Peter Kahrel
    Participant

    You find that the way you find the script code for any InDesign marker: insert it in the Find/Change dialog and you’re there. In this case, open the Find/Change dialog, click the @ next to the ‘Find what’ field, click ‘Markers’ then ‘Footnote reference marker’. You’ll now see ~F in the ‘Find what’ field and that’s what you use in your script:

    app.findGrepPreferences.findWhat = ‘~F’;

    (or ^F if you use text rather than grep).

    Peter

    in reply to: Page count for a range of pages #114111
    Peter Kahrel
    Participant

    Well, Michel, care to share how you obtain the selected pages in the Pages panel?

    P.

    in reply to: extract text from all anchored frames #114109
    Peter Kahrel
    Participant

    I have used this script for that:

    (function () {
    	var stories = app.documents[0].stories;
    	var ix;
    	for (var i = stories.length-1; i > -1; i--) {
    		while (stories[i].textFrames.length > 0) {
    			ix = stories[i].textFrames[-1].parent.index;
    			stories[i].textFrames[-1].texts[0].move (LocationOptions.AFTER, stories[i].insertionPoints[ix]);
    			if (stories[i].textFrames[-1].locked) {
    				stories[i].textFrames[-1].locked = false;
    			}
    			stories[i].textFrames[-1].remove();
    		}
    	}
    }());
    
    in reply to: Search for different indent sizes with one command? #113995
    Peter Kahrel
    Participant

    Unfortunately that’s not possible. Please submit a feature request (at https://indesign.uservoice.com).

    P.

    in reply to: Can you help me adapt this table script? #113675
    Peter Kahrel
    Participant

    Missed that… Change this line:

    if (cells[j-1].contents == '')

    to this:

    if (cells[j].contents == '')

    P.

    in reply to: Need GREP for superscript interchange #113673
    Peter Kahrel
    Participant

    Aha, ok. So if a period on the baseline is followed by a superscripted number, the period and the number need to be swapped. If that’s what you want, then that’s not possible just like that because in InDesign you can’t search for two items with different formatting. So if you search for (\.)(\d+) you can’t specify that the dot should be normal and the number in superscript. You can use a three-step approach for this: expose the superscript as a text tag, do the change, and revert the superscript code. As follows:

    1. Find what: (\d+)
    Change to: %sup%$1
    Find format: position superscript
    Change format: position normal

    .12 is now changed to .%sup%12
    You can use any text tag you like.

    2. Find what: \.(%sup%\d+)
    Change to: $1.
    (Blank the Find format and Change format panels)

    3. Find what: %sup%(\d+)
    Change to: $1
    Find format: leave blank
    Change format: position superscript.

    P.

    in reply to: Can you help me adapt this table script? #113667
    Peter Kahrel
    Participant

    It’s not so clear what’s going wrong. And that script is rather inefficient — here is another approach:

    var i, j, cells;
    // Get all the rows in the document
    var rows = app.documents[0].stories.everyItem().tables.everyItem().rows.everyItem().getElements();
    for (i = 0; i < rows.length; i++) {
    	// Get all the cells in a row
    	cells = rows[i].cells.everyItem().getElements();
    	for (j = cells.length-1; j >= 1; j--) {
    		if (cells[j-1].contents == '') {
    			cells[j-1].merge (cells[j]);
    		}
    	}
    }

    P.

    in reply to: Need GREP for superscript interchange #113666
    Peter Kahrel
    Participant

    What is an online dot? Better show a screenshot that shows what you have now and how you would like it to be.

    P.

    in reply to: Paragraph Styles #113483
    Peter Kahrel
    Participant

    paragraphstyles should be paragraphStyles (JavaScript is case-sensitive). But it’s spelled correctly in your code. And your script works fine.

    P.

    in reply to: (foot)note on a footnote #113482
    Peter Kahrel
    Participant

    I suggest that you get in touch with https://www.id-extras.com/. They have done excellent work on INDesign footnotes (and they’re in Israel).

    P.

    in reply to: NEED HELP: Adding Suffix To Character String #113460
    Peter Kahrel
    Participant

    Saw Kal’s post only a minute ago. Now why didn’t I think of GREP :)? But it can be done simpler:

    Find what: (.)\Z
    Replace with: $1-X

    (.)\Z matches any character at the end of a story and replaces it it with itself and -X

    P.

    in reply to: NEED HELP: Adding Suffix To Character String #113459
    Peter Kahrel
    Participant

    A simple script:

    frames = app.documents[0].textFrames.everyItem().getElements();
    for (i = 0; i < frames.length; i++) {
    frames[i].contents += ‘-X’;
    }

    If there’s any formatting in the frames you need the slower version:

    frames = app.documents[0].textFrames.everyItem().getElements();
    for (i = 0; i < frames.length; i++) {
    frames[i].insertionPoints[-1].contents = ‘-X’;
    }

    P.

    Peter Kahrel
    Participant

    You have to be able to identify text frames on the document pages, and the easiest way to achieve that would be to name them on your master pages. So if you have two text frames on each page, one at the top and one at the bottom, name the top one ‘A’ on the Layers panel. Then override the top frame on the first page and place text in it. The frame will be overset. Now write a script that, while the story is overset, adds a page, overrides frame ‘A’, and links it to the previous frame ‘A’. You can do that with as many frames as needed, call them ‘B’, ‘C’, etc.

    in reply to: Measuring the actual width of a space (in Tasmeem) #113439
    Peter Kahrel
    Participant

    You can look for a space, then take the distance between the first and the second horizontal offsets. And compare that with your ‘certain measurement’.

    P.

Viewing 15 posts - 106 through 120 (of 340 total)