Back

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

  • You must be logged in to reply to this topic.Login

Finding objects of particular Object Style

Return to Member Forum

  • Author
    Posts
    • #64121
      Tom Pardy
      Member

      I am using InDesign CS5.5 and my 50-page document has a huge number of red diamond shapes (a red-filled square rotated 45 degrees) scattered through it that have been used as markers to show which items in the document have been dealt with. Now I have completed the work and wish to remove them all.

      It seemed to me that, since every one of them has a particular Object Style (and no other objects in the document having that Object Style) that it ought to be a simple matter of using the Find//Change dialog box to find and replace (with none) all of them. But the Find//Change dialog box, whilst it has a tab called “Object” that tab does not offer the possibility of finding an object by its Object Style. It insists on my defining every feature of the object (and even then doesn’t seem to be able to find any of them).

      Is there some simple way around this? By “simple” I mean something less tedious than going through page by page, selecting the red diamonds one by one and deleting them.

      With forethought (which I typically lack), I should have had all those diamonds put onto their own layer and then it would simply have been a mater of deleting that layer. But that will be my solution NEXT time!

    • #64123
      Hopsa Rijnen
      Member

      Still some handy work, but perhaps a faster way of doing it, it takes some effort to tweek the settings fitting to your needs, i used it for real once or twice, and at those times you're happy it exists! And even for free! They have much more delicious plugins

      https://www.rorohiko.com/wordpr…..findslike/

      good luck

    • #64124
      Bob Rubey
      Member

      Hi Furry,

      If they're just rotated rectangles, the SelectObjects script might do the job. Choose only Rectangles from the list.

      Bob

    • #64125
      Hopsa Rijnen
      Member

      Even better! Did you use that colour only on those diamonds? Hope so;

      delete the colour and replace it for [None], you're done!

    • #64126
      Tom Pardy
      Member

      Thank you, Hopsa. I have downloaded that plugin from Rorohiko (I already have their wonderful Soxy in constant use) and tried it out briefly. It seems to do the job for a particular spread, which will certainly make life a little easier, even if I still have to go through spread by spread.

      Thank you, Bob. I haven’t yet tried hunting for rectangles — it is late at night here so will have a go tomorrow. But there are other rectangles on every one of the pages (though not coloured red) so there may be a little tinkering to do. We’ll see tomorrow …

      Thank you both again! :-)

    • #64127
      Tom Pardy
      Member

      Hopsa, you posted while I was still composing my previous post. I will check out your suggestion tomorrow as well.

    • #64128
      David Blatner
      Keymaster

      Also, the Object tab of the Find/Change dialog box doesn't require you to search for ALL the formatting. You should be able to dial in just the red stroke (or whatever)… maybe you were being too detailed in your search.

    • #64129

      Furry, feel free to correct me if I'm mistaken …

      … the Find//Change dialog box, whilst it has a tab called “Object” that tab does not offer the possibility of finding an object by its Object Style.

      … in my InDesign CS4, I find that the Find Object dialog does allow you to select any pre-defined Object Style. Just select the category “Style Options”, and at the right hand side of the dialog you can select your particular style from the drop down list.

      Other than in the Text Find & Change, you cannot replace an object with 'Nothing'; but you can use the Find Next hot key … oh wait, you can't (it seems this defaults back to Find Text). Well, you can use the Find Next button then.

    • #64131
      dleather
      Participant

      Or (to follow up on Jongware's post) create a style that is in essence “nothing” and replace it with your new, custom, absolutely blank style. (You may have to set up one variable – like changing the opacity to 0% or something that won't affect the rest of your document.)

    • #64136

      Adding transparency might have side effects,though. Is it possible to set an object to Non-Printing in the Find/Change Object dialog?

    • #64139
      Tom Pardy
      Member

      Thanks, all of you.

      I tried putting in just one attribute (Fill: red) as you suggested, David, and that worked in the sense that it found the very first of all the red diamonds. Step one completed.

      And thank you, Jongware, I had overlooked that Style Options section, thinking it was for something other than defined object styles — silly me!

      But I am still confused about a few things.

      Please, dleather, how do I create such a “nothing” style? I tried the suggestion of defining a new style (called “Nothing”, of course) with just one characteristic — I set opacity to zero. Then I ran the Find/Change dialog box and it found the first red diamond OK, but when I clicked “Change”, it stripped the diamond of all stroke and fill and left the (now empty) frame in the document. It would no longer print, of course, but it was certainly still there. Had I chosen “Change All”, I would still have had scores of empty frames in the document — not a desirable outcome.

      My guess is that having any other single attribute would achieve the same result. Jongware, I don’t think it is possible to define an object style to include Non-Printing. It doesn’t seem to be an option anywhere in the New Object Style dialog box — but then, I have been known to overlook the obvious in the past! Even so, it would not be an automated means of deleting all these no-longer-wanted objects, simply of making them inert.

      I will certainly go for the separate layer option next time around!

    • #64141

      Furry, after all said and done it wasn't as hard to script as I imagined … The following Javascript will add a layer, then move all of the objects with style “YourStyleNameHere” to the new layer. I opted doing it this way, rather than *automatically* delete the objects – that's also scriptable, but now you can toggle off all other layers and first review what's going to be deleted!

      app.findObjectPreferences = null;
      app.findObjectPreferences.appliedObjectStyles = "YourStyle";
      found_list = app.activeDocument.findObject(true);
      newLayer = app.activeDocument.layers.add();
      try { newLayer.name = "Delete Me"; } catch (e) { }
      for(i=0; i<found_list.length; i++)
      found_list[i].move(newLayer);

      (Edit) added 'null' line above

    • #64142

      A short breakdown of this script:

      line 1: reset the findObject dialog to an empty state. Important, because there may have been some previous settings lingering!

      line 2: this sets the Object Style to look for, nothing else.

      line 3: this performs the actual finding. The parameter 'true' returns the found list in reverse order. This is important, because you must change objects from last to first, else InDesign gets confused.

      line 4: add a default new layer

      line 5: sets the name of this new layer. It's wrapped by a try .. catch, because if a layer already exists with this name (“Delete Me”), the command will fail and the script will stop. With the try..catch wrapper it will continue and the new layer will keep its default name (“Layer 3” or something like that)

      line 6: loop over the list of found objects. Usually, this is done in reverse (to prevent aforementioned messing up ID's internal stack), but since line 3 already provided the list in reverse order, you can loop forward.

      line 7: move each of the objects to this new layer.

      Line 7 could also be changed to:

      • found_list[i].remove(); // immediately and irrevokably delete the items …
      • found_list[i].nonprinting = true; // set the object to non-printing
      • found_list[i].appliedObjectStyle = “SomeOtherStyle”; // if you want to do something else
      • … World = Oyster, Wish = Command, etc., from this point on!
    • #64143
      Tom Pardy
      Member

      Johnware, your brilliance at scripting continues to amaze me!

      I find scripting utterly baffling most of the time but your line by line explanation is most instructive. Thank you!

      But then I have colleagues who are totally unsettled by CSS whereas to me it makes a lot of sense — I guess it is horses-for-courses.

      Thank you again.

    • #95565

      You are really amazing Theunis De Jong. Your script are brilliant, it help us a lot here. You are really one of the InDesign master here.

Viewing 14 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads