BIKE – Toggle type of selected row(s) Body ⇄ Heading

A macro for Jesse Grosjean's Bike Outliner (versions 1.14 onwards) which toggles the Heading status of selected lines on or off.


BIKE – Toggle type of selected row(s) Body ⇄ Heading.kmmacros (23 KB)


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.";
})();

Other Keyboard Maestro macros for BIKE Outliner

2 Likes

Thank you.

1 Like

Jesse Grosjean ... it was a sad day when Mori died.