Finding one's place in the outline

Sometimes I have such lengthy and complex outlines that I can’t remember where exactly I am in the nesting. I was wondering if there is any way to show that, meaning under what parents my row is currently located. Thanks!

Without having to scroll up, I mean

I suppose one approach would be to display the path, using a plugin of some kind:

( Could probably be modified to let you choose an ancestral line to jump to, if that was relevant)

context.omnijs.zip (1.5 KB)

2 Likes

Thank you! I’m not an expert computer person, so if someone could share with me how I activate such a plug-in in OO5, I’d be very grateful!

Assuming that you are running OO5 Pro, I think the steps would be:

  • unzip the downloaded zip file to obtain a context.omnijs file
  • in the OO main menu Automation > Configure
  • drag the context.omnijs file onto the configuration window which appears.

Once you have done that:

  • You should see Context as an item when you choose Automation from the main menu.
  • You should also be able, optionally, to:
    • Ctrl-click the toolbar
    • Choose Customize Toolbar
    • Visually hunt for a button with the name Context and a green plug icon, and drag that onto the toolbar.

If the Context button is installed, clicking it should produce a display like:

2 Likes

That worked perfectly! Thank you very much!

1 Like

I must say, the more I use this, the more helpful I find it. One way that it’s very useful is when you’re searching for a term and you don’t know from which section the hit comes (especially since the OO search results do not show whether the result has children). This context plug-in will tell you immediately. And then you can decide more easily which hit to look at first. Truly very, very helpful. Thanks again!

Good ! Kind of you to let me know :-)

( Not sure whether jumping to an ancestor, or opening another window for one, is part of the work-flow, but if it was, the plugin could probably be modified to make that easier. Otherwise, have fun with it :-)

No, I’ll be alright not jumping to an ancestor. Just knowing where I am is invaluable. You’ve made life a whole lot easier for me.

1 Like

This is useful. Thanks! Do you know if there is any control over the width of the message display?

Here’s a result on the iPad.

I don’t immediately see any width controls on their

  • Alert
  • or Form.Field.String

interfaces, but might it help to have an option to truncate, and only show the first N characters of each line (to avoid wrapping) ?

For a maximum of 20 chars, for example, you could edit the contents of context.omnijs to something like:

/*{
    "author": "Rob Trew",
    "targets": ["omnioutliner"],
    "type": "action",
    "identifier": "com.mycompany.Untitled Action",
    "version": "0.1",
    "description": "Display of selection path",
    "label": "Context",
    "mediumLabel": "Context",
    "paletteLabel": "Context",
}*/
(() => Object.assign(
    new PlugIn.Action(selection => {
        const main = () => {
            const maxChars = 20; // or change number to 0 or undefined
            const items = selection.items;

            const cropped = s =>
                Boolean(maxChars) ? (
                    s.slice(0, maxChars) + '...'
                ) : s;

            return bindMay(
                items.length ? (
                    Just(items[0])
                ) : Nothing()
            )(
                item => Just(
                    buttonChoiceMay(
                        'Ancestors of selection'
                    )(
                        item.ancestors
                        .map(x => cropped(x.topic))
                        .reverse()
                        .concat(item.topic)
                        .reduce(
                            (a, x, i) => a + '\n' + (
                                '    '.repeat(i) + x
                            ),
                            ''
                        )
                    )([])
                )
            );
        };

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

        // Just :: a -> Maybe a
        const Just = x => ({
            type: 'Maybe',
            Nothing: false,
            Just: x
        });

        // Nothing :: Maybe a
        const Nothing = () => ({
            type: 'Maybe',
            Nothing: true,
        });

        // bindMay (>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b
        const bindMay = mb =>
            // Nothing if mb is Nothing, or the application of the
            // (a -> Maybe b) function mf to the contents of mb.
            mf => mb.Nothing ? (
                mb
            ) : mf(mb.Just);

        // buttonChoiceMay :: String -> String -> 
        // [String] -> Maybe String
        const buttonChoiceMay = title =>
            msg => buttons => {
                const
                    options = ['Cancel'].concat(buttons)
                    .reverse();
                let result;
                return (
                    // --------------- IO ----------------
                    options.reduce((a, k) => (
                        a.addOption(k),
                        a
                    ), new Alert(title, msg))
                    .show(n => result = n),

                    // -------------- VALUE --------------
                    result !== buttons.length ? (
                        Just(options[result])
                    ) : Nothing()
                );
            };


        return main();
    }), {
        validate: selection => true
    }
))();

That helps. Thanks!

I’ve made a slight edit above to allow for a trailling ... ellipsis,
just to clarify that the string is truncated.

Script and explanation of how to use very helpful - Thanks!