hammerspoon2-docs
    Preparing search index...

    Function create

    • Creates a window filter

      Parameters

      • Optionalrules:
            | string
            | string[]
            | {
                apps?: Record<string, boolean | object>;
                default?: boolean | object;
                override?: boolean | object;
                sortOrder?: "focusedLast" | "focused" | "createdLast" | "created";
            }
            | ((window: HSWindow) => boolean)

        What the filter allows: omit it for a copy of hs.windowfilter.defaultFilter (including any changes you've made to it); an application's name or bundle ID, or an array of them, for those applications' visible windows; a function, called with each window, that returns true to allow it; or an object of rules:

      Returns HSWindowFilter | null

      The new filter

      Throws an Error on failure; wrap calls in try/catch to handle it.