Searching for objects is something you will only need to do in complex documents—but when you need it, you will be glad Inkscape can do it. This chapter on selection is the best place to discuss object searching simply because it is, in essence, yet another way to select objects.
The main way to search is to use the Find dialog (Figure 5-8) that you can call by pressing or by selecting Edit ▸ Find.
You can search by typing your query in one or more fields, as described below. If you specify a value for more than one search field, they are combined using the logical “and”—that is, only those objects are found that satisfy all the specified criteria.
Text
This field applies only to text objects (Chapter 15) and searches within their text content. The search is case sensitive. If there are objects whose text exactly corresponds to the query string, only those objects get selected; otherwise, Inkscape tries to find partial matches—i.e., those text objects whose contents contain the query string.
ID
This searches within the id
attribute of all objects (A.9 Linking). This only makes sense when some of your IDs are meaningful, that is, set by you and not generated automatically by Inkscape. As with text, Inkscape first tries to find exact matches and, failing that, looks for partial matches.
Style
This field allows you to search within the style of objects. Unfortunately, since this is a simple text field, to use this feature you need to have at least some idea of how style is written in SVG (see A.8 Style). Here are a few examples:
Finding all red-filled objects
This is possible but only for one specific red color, which you must know how to convert into the RRGGBB form. For example, the “bright red” in the color palette is ff0000
in RRGGBB notation, and in an object’s style string this is preceded by a hash mark (#
) and the name of the property, fill
, separated by a colon. So, the entire search string will be fill:#ff0000
.
Finding all objects without stroke or fill
Search for stroke:none
or fill:none
.
Finding all fully transparent objects
Search for opacity:0;
(note the separator semicolon at the end; without it, it will also find all partially transparent objects—for example, those with opacity:0.5;
in their style).
Attribute
This field searches for objects that, in SVG, have an attribute with this name (regardless of its value). For example, all objects that you export to bitmap using selection export get the attribute inkscape:export-filename
, which stores the filename of the bitmap export file. So, searching for this attribute will select all objects in the document that were ever exported (following which you can, for example, export them all again, see 18.9 Bitmap Export).
Type
This allows you to search for objects of specific types. Unchecking the All types checkbox opens up a column of other checkboxes corresponding to various object types:
Leave checked only those types that you want to find. You can combine this with the other search criteria listed above.
In addition to the search fields, four checkboxes at the bottom of the dialog enable various search options:
Search in selection
This allows you to narrow the current selection instead of searching the entire document.
Search in current layer
By default, Inkscape searches in all layers. Check this to limit the search to the current layer.
Include hidden and Include locked
By default, Inkscape’s search ignores hidden and locked objects, as well as objects in hidden or locked layers. Check these to enable searching within hidden and/or locked objects.