Outline paths can be significantly more performant than AppleScript's filtering operations.
For example, //*/run::@strong gets interpreted as:
- For all descendants of the root node,
- Look at their associated rich text by using run:: axes, then
- Run predicate against the attributes associated with each rich text run’s attributes.
Within Bike, outline paths can return different kinds of values:
count(//*)returns a number.//*returns a list of “nodes” (rows and/or text runs).
To avoid implementation complexity, Bike's automation interfaces behave slightly differently:
-
In Shortcuts, “Query Rows” only returns rows --
count(//*)returns an empty list. -
In AppleScript, the “query” command returns rows and numbers, but not text runs. Instead, add
/..to the end of the query to obtain the parent rows containing the matching text runs, not the text runs themselves. For example://*/run::@strong— Zero results in AppleScript since no text run results//*/run::@strong/..— Returns all rows that contain strong (bold) text.
For more information, see the following resources: