I’m finding it helpful to have a quick on-off toggle for Heading status:
Expand disclosure triangle to view JS source
(() => {
"use strict";
// Toggle type of selected Bike rows Body ⇄ Heading
// Rob Trew @2023
// Ver 0.1
const doc = Application("Bike").documents.at(0);
return doc.exists()
? (() => {
const
rows = doc.rows.where({
selected: true
});
return 0 < rows.length
? (() => {
const
newType = (
"heading" === rows.at(0)
.type()
)
? "body"
: "heading";
return (
rows().forEach(
x => x.type = newType
),
newType
);
})()
: "No rows selected in Bike.";
})()
: "No document open in Bike.";
})();
To test in Script Editor, set the language selector at top-left to JavaScript
(rather than AppleScript).
See: Using Scripts - Bike