Bike 1.4 Preview (78)

  • Lighten guide color slightly
  • Simplified highlight drawing
  • Open links in frontmost document window
  • Updated license description in preferences
  • Disable “Remove” in link popover when appropriate
  • Edit > Copy Link now includes rich text link
  • Window tab titles to match focused row
  • Fixed visible typing attributes display

To get preview releases through Bike’s software update select: Bike > Preferences > General > Include “preview” releases.

4 Likes

:+1: This is very helpful – thank you !

1 Like

It is! However, for me it breaks the “Focus In” and “Focus Out” keyboard shortcuts when there is more than one tab open. If I open a “New Tab,” then try to do cmd-opt-left/right, what I get seems to be more like “expand/collapse all” instead of changing the focus. Focus In and Out do still work fine if selected in the menu. The keyboard shortcuts work as expected when I have only one tab open.

In the meanwhile, if you want to experiment, here is a script which aims to:

  1. Open a new tab, and
  2. focus, in that tab, on the currently selected line.

To test in Script Editor.app choose JavaScript from the language selector at top right.


Expand disclosure triangle to view JS source
(() => {
    "use strict";

    // New Bike app tab focused on selected row.

    // Rob Trew @2022
    // Ver 0.01

    // main :: IO ()
    const main = () => {
        const
            bike = Application("Bike"),
            doc = bike.documents.at(0);

        return doc.exists() ? (() => {
            const
                rows = doc.rows.where({
                    _and: [
                        {selected: true},
                        {_not: [{
                            name: ""
                        }]}
                    ]
                });

            return 0 < rows.length ? (() => {
                const selectedRowID = rows.at(0).id();

                return (
                    bike.activate(),
                    bundleMenuItemClicked(
                        "com.hogbaysoftware.Bike"
                    )(["File", "New Tab"]) ? (() => {
                            const
                                tabDoc = bike.windows.at(0)
                                .document();

                            return Boolean(
                                tabDoc.focusedRow = tabDoc
                                .rows.byId(selectedRowID)
                            );
                        })() : "Menu item not clicked."
                );
            })() : "No line of text selected.";
        })() : "No documents open in Bike";
    };

    // --------------------- GENERIC ---------------------

    // bundleMenuItemClicked :: String -> [String] -> IO Bool
    const bundleMenuItemClicked = bundleID =>
        menuPath => {
        // True if an item at the specified menu path
        // has been successfully clicked in an
        // application with the given bundle identifier.
            const intMenuPath = menuPath.length;

            return intMenuPath > 1 ? (() => {
                const
                    appProcs = Application("System Events")
                    .processes.where({
                        bundleIdentifier: bundleID
                    });

                return 0 < appProcs.length ? (
                    Application(bundleID)
                    .activate(),
                    menuPath.slice(1, -1).reduce(
                        (a, x) => a.menuItems[x].menus[x],
                        appProcs[0].menuBars[0].menus
                        .byName(menuPath[0])
                    )
                    .menuItems[menuPath[intMenuPath - 1]]
                    .click(),
                    true
                ) : false;
            })() : false;
        };

    // MAIN ---
    return main();
})();

Using Scripts - Bike

Is anyone else seeing this problem? Focus In / Focus Out keyboard shortcuts seem to be working OK for me with or without tabs.

Seems, FWIW, to be working fine here with macOS 11.7 and Bike 78.

Ahhh! Sorry folks, false alarm. I forgot I had a system-wide keyboard shortcut set for “Show Next Tab” and “Show Previous Tab”—it wasn’t a conflict before in Bike because I never used multiple tabs until now! Once I deleted that shortcut in System Settings, the Bike behavior returned to normal.

1 Like