Adjusting legacy Bike 1 Applescripts and JXA for Bike 2

New scripts for Bike 2 are probably best written in terms of the fuller and faster new extensions API,
but for any existing Bike 1 osascripts that we might want to continue using, at least for a while, in Bike 2, I noticed one difference this morning, which I may have forgotten from earlier discussion:

old row.level → new row.depth

checking why an old (Bike 1 → OmniGraffle diagram) script wasn’t yet working with Bike 2, I found a line which gathered the indentation levels of a series of rows by writing:

rows.level()

a quick check revealed that for Bike 2 this would need editing to:

rows.depth()

(Forgive me if we have already discussed this – I suspect we probably have :slight_smile: )

Ah, sorry about that.

I think there is a way that I can add a hidden backward compatibility to the AppleScript layer.

I think I was trying to bring code into consistency with that change, but now I notice the extension API is using level. The shortcuts API uses depth. And my Swift code uses depth. And my UI menu labels use Level.

Grrr!

Any thoughts on how best to standardize!?

Thinking more… I think I will standardize on level. So I’ll be changing AppleScript API back. Unless when doing so I run into issue of why I changed in first place.

1 Like