Bike 1.17.2 (165)

Finally got a new preview release out!

Excepting any bugs (let me know!) that show up I think this is close to what I want for Bike 1.17 final release. Hope to make final 1.17 release early next week.

Outline paths still aren’t “done”, for example I want to add date support at some point, but I think the foundation is solid and extra features like dates can be fairly easily added later.

Lots of details have changed compared to the previous preview release, but big picture is still the same.

For outline paths I changed to color syntax highlighting. Warm colors are operators and controls. Cool colors are values. Generally they alternate in the syntax, so I think it makes them easier to visually parse. I decided against syntax changes (such as adding marker syntax for row types) and instead think the colors work pretty well.

I’ve also done a bunch of autocomplete work. I think it works really well for tags. Less certain about axes and axes type filters. In most paths I almost never need to specify these things (or I use a standard shortcut) so maybe the autocomplete is distracting. At the same time the autocomplete shows you all possibilities. I’m including it more as documentation then as something that will help you type faster.

The new run:: axes is an important addition. For one it’s needed for stylesheets, so that text runs can be styled. It also might be generally useful, for example could use to discover backlinks. When you see this search //*/run::@strong it is saying:

  1. For all descendants of the root node
  2. Look at their associated rich text by using run:: axes
  3. Run predicate agains the attributes associated with each rich text run’s attributes.

The last big addition to this release is that now you can use outline paths from Bike’s scripting dictionary and shortcut actions. Using outline paths can be much more performant (and less code) then performing filtering operations using the automation apis.

tell application "Bike"
	tell front document
		query outline path "//pizza"
	end tell
end tell

One complexity of outline paths is they can result in different kinds of values. For example a path such as count(//*) returns a number. While a path such as //* returns a list of “nodes”. In the case of Bike each node returned might be a row, or might be a text run.

Modeling all of that for consumption by AppleScript or AppleShortcuts would take a lot of work and add a lot of complexity, so instead of taken the cleanest path of least resistance.

  1. When using Bike’s shortcut “Query Rows” action only rows will be returned. count(//*) will just return an empty list.

  2. When using Bike’s AppleScript dictionary “query” command rows and numbers are returned, but text runs will not be returned. If you want to make a query that includes text runs what you can do is as a last step ask for the parents, and then you will get the rows containing the runs. For example:

    • //*/run::@strong - zero results in AppleScript since no text run results
    • //*/run::@strong/.. - returns all rows that contain strong (bold) text.

And there’s an updated icon! Thanks @Erlend for the ideas.

3 Likes