Forum Replies Created
-
AuthorPosts
-
Ari Singer
MemberThis 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; }Ari Singer
MemberI’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.
Ari Singer
MemberYou can upload a picture to any image-hosting website (such as imgur.com or dropbox.com) and post the link here.
Ari Singer
MemberI 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.
Ari Singer
MemberDo a GREP Find/Change with the following settings:
Find What:
\r\rChange To:
\rHit “Change All”.
This basically finds any instance of two carriage returns one after the other, and replaces it with just one.
Ari Singer
MemberWhen you try to override, do you get a pop-up asking you to confirm the override?
Ari Singer
MemberWhenever 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\rit has to ber.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”} {}Ari Singer
MemberOkay, now I understand. But what constitutes an ’empty’ graphic frame? When is considered to be empty?
Ari Singer
MemberI 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…
Ari Singer
MemberUntil 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, $1What 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.
May 27, 2016 at 2:39 pm in reply to: Suppress transparency on placed InDesign file in InDesign? #85269Ari Singer
MemberTry 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.
Ari Singer
MemberYes, I realized it just after I posted the script. It’s not fully baked yet…
Ari Singer
MemberTry 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(); } } }Ari Singer
MemberYou’re right.
Ari Singer
MemberOne 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”.
-
AuthorPosts
