Find and change only on odd or even pages
Learn / Forums / General InDesign Topics / Find and change only on odd or even pages
Tagged: change, find, odd even left right, Search
- This topic has 16 replies, 5 voices, and was last updated 8 years, 2 months ago by Bart Eenkhoorn.
-
AuthorPosts
-
-
August 19, 2014 at 1:14 am #70141William GreenwoodMember
Hi,
Does anyone know of a plugin, script, or even a way in InDesign itself, to allow a find/change to affect only odd or even (left or right) pages only.
Cheers
b.
-
August 19, 2014 at 7:00 am #70144David BlatnerKeymaster
Hm. Can’t think of anything off the top of my head, sorry.
-
August 19, 2014 at 7:17 am #70147William GreenwoodMember
I can style sheet everything then search choosing the style sheet, but this is a bit messy and you have to preplan everything.
Another option would be to get a javascript to turn all text on odd (or even) numbered pages green (for example), then use this as the filter. The script could turn text back to black after.
Have you come across a script that can change text depending on page number David?
Cheers
Bill
-
August 19, 2014 at 8:48 am #70149David BlatnerKeymaster
Nope.
Maybe put the objects on different layers, then lock the layers when doing find/change? -
August 20, 2014 at 1:08 am #70163Eugene TysonMember
Amazing – Find Change won’t work on a locked text frame – but spell check will still check locked frames.
Think the OP just needs a script to lock odd pages or lock even pages.
-
January 2, 2016 at 5:31 am #80502Bart EenkhoornParticipant
I have the same need and posted it here the other day: https://creativepro.com/topic/findchange-on-left-or-right-page-only
Have you come across a solution already Bill? Or are we looking at one of the few things that Indesign cannot do? -
January 27, 2016 at 2:33 am #81150William GreenwoodMember
Nothing so far. :(
I guess you could write an applescript that selected text frames on odd / even (left /right) pages and gave each frame a standard object style, then search within those.
-
January 27, 2016 at 12:07 pm #81155Peter KahrelParticipant
Here is a general template for targeting left- or right-hand pages. This particular example underlines numbers on left-hand pages. Change
LEFT_HAND
toRIGHT_HAND
to target rectos. Make other changes as needed in lines 4 and 9.(function () { app.findGrepPreferences = null; app.findGrepPreferences.findWhat = '\\d+'; var found = app.activeDocument.findGrep(); for (var i = found.length-1; i >= 0; i--) { if (found[i].parentTextFrames.length > 0 && found[i].parentTextFrames[0].parentPage.side === PageSideOptions.LEFT_HAND) { // i.e. not overset and on a recto // Do something, e.g. found[i].underline = true; } } }());
Peter
-
January 28, 2016 at 3:08 am #81181William GreenwoodMember
I’ll give this a go. Thanks Peter :)
-
January 29, 2016 at 2:45 am #81205Bart EenkhoornParticipant
I will try this as well. Thanks in advance Peter, much appreciated.
-
January 29, 2016 at 3:08 am #81207Bart EenkhoornParticipant
Just tried it, produces error 23, String: does not have a value, line 5: offending Text: =
for (var i = found.length-1; i >= 0; i–) {Does that mean that the script thinks my document does not have textframes? I am using a 14 page document with a textframe on each page. I am just a cut-and-paste javascript user, so I have no clue what can cause the error.
-
January 30, 2016 at 3:45 am #81232Peter KahrelParticipant
I’ve no idea what goes wrong at your end. Works fine here with a variety of texts. What does your text look like, and what are you looking for?
-
January 30, 2016 at 4:50 am #81233William GreenwoodMember
I too am getting a JavaScript Error
I named the javascript z.Find_Change_LH.jsx and this is the error. Any ideas?Error Number: 21
Error String: null is not an objectEngine: main
File:/Applications/Adobe InDesign CC 2014/Scripts/Scripts Panel/ Samples/JavaScripts/z.Find_Change_LH.jsxLine: 6
Source: if (found[i].parentTextFrames.length > 0 && found[i].parentTextFrames[0],parentPage.side === PageSideOptions.LEFT_HAND) { -
January 30, 2016 at 6:23 am #81235Peter KahrelParticipant
Bill, B. Eenkhoorn — the script clearly runs into a situation that I’m unaware of. Can you post your documents so that I can have a look?
-
February 1, 2016 at 9:12 am #81293Bart EenkhoornParticipant
Here is a link to the (working) document Peter:
https://goo.gl/VT2CqU
For the right-side pages I want the verse numbers to move to the right side of the page. So if I could find/change the right-side object styles separate from the left page ones, I can then change these object styles to move to the right side.
Thanks in advance for your help,
Bart -
February 1, 2016 at 9:58 am #81297Peter KahrelParticipant
Bart,
I see the problem. What you find is in an anchor, so the script should do the sidedness test a bit differently.
But for what you want to achieve you don’t need a script at all: in the object-style window, in the Anchored Object Options panel, there’s a checkbox ‘Relative to spine’. Check that box and all your anchored v_margin frames will appear on the left-hand side of the main text on left-hand pages and on the right-hand side of the main text on right-hand pages.
Hartelijke groet,
Peter
-
February 1, 2016 at 10:23 am #81298Bart EenkhoornParticipant
Ah, this is great, and how could I have missed that. Dank je wel Peter.
Bart
-
-
AuthorPosts
- You must be logged in to reply to this topic.