Graphical, interactive tool for choosing/searching data
Notes:
| Signature | hs.chooser.globalCallback |
|---|---|
| Type | Variable |
| Description | A global callback function used for various hs.chooser events |
| Notes |
|
| Source | extensions/chooser/chooser.lua line 29 |
| Signature | hs.chooser.new(completionFn) -> hs.chooser object |
|---|---|
| Type | Constructor |
| Description | Creates a new chooser object |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/chooser/libchooser.m line 14 |
| Signature | hs.chooser:attachedToolbar([toolbar]) -> hs.chooser object | currentValue |
|---|---|
| Type | Method |
| Description | Get or attach/detach a toolbar to/from the chooser. |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/chooser/chooser.lua line 13 |
| Signature | hs.chooser:bgDark([beDark]) -> hs.chooser object or boolean |
|---|---|
| Type | Method |
| Description | Sets the background of the chooser between light and dark |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/chooser/libchooser.m line 539 |
| Signature | hs.chooser:cancel() -> hs.chooser object |
|---|---|
| Type | Method |
| Description | Cancels the chooser |
| Parameters |
|
| Returns |
|
| Source | extensions/chooser/libchooser.m line 805 |
| Signature | hs.chooser:choices(choices) -> hs.chooser object |
|---|---|
| Type | Method |
| Description | Sets the choices for a chooser |
| Parameters |
|
| Returns |
|
| Notes |
Example: local choices = {
{
["text"] = "First Choice",
["subText"] = "This is the subtext of the first choice",
["uuid"] = "0001"
},
{ ["text"] = "Second Option",
["subText"] = "I wonder what I should type here?",
["uuid"] = "Bbbb"
},
{ ["text"] = hs.styledtext.new("Third Possibility", {font={size=18}, color=hs.drawing.color.definedCollections.hammerspoon.green}),
["subText"] = "What a lot of choosing there is going on here!",
["uuid"] = "III3"
},
}```
|
| Source | extensions/chooser/libchooser.m line 110 |
| Signature | hs.chooser:delete() |
|---|---|
| Type | Method |
| Description | Deletes a chooser |
| Parameters |
|
| Returns |
|
| Source | extensions/chooser/libchooser.m line 444 |
| Signature | hs.chooser:enableDefaultForQuery([]) -> hs.chooser object or boolean |
|---|---|
| Type | Method |
| Description | Gets/Sets whether the chooser should run the callback on a query when it does not match any on the list |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/chooser/libchooser.m line 584 |
| Signature | hs.chooser:fgColor(color) -> hs.chooser object |
|---|---|
| Type | Method |
| Description | Sets the foreground color of the chooser |
| Parameters |
|
| Returns |
|
| Source | extensions/chooser/libchooser.m line 461 |
| Signature | hs.chooser:hide() -> hs.chooser object |
|---|---|
| Type | Method |
| Description | Hides the chooser |
| Parameters |
|
| Returns |
|
| Source | extensions/chooser/libchooser.m line 70 |
| Signature | hs.chooser:hideCallback([fn]) -> hs.chooser object |
|---|---|
| Type | Method |
| Description | Sets/clears a callback for when the chooser window is hidden |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/chooser/libchooser.m line 199 |
| Signature | hs.chooser:invalidCallback([fn]) -> hs.chooser object |
|---|---|
| Type | Method |
| Description | Sets/clears a callback for invalid choices |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/chooser/libchooser.m line 415 |
| Signature | hs.chooser:isVisible() -> boolean |
|---|---|
| Type | Method |
| Description | Checks if the chooser is currently displayed |
| Parameters |
|
| Returns |
|
| Source | extensions/chooser/libchooser.m line 91 |
| Signature | hs.chooser:placeholderText([placeholderText]) -> hs.chooser object or string |
|---|---|
| Type | Method |
| Description | Sets/gets placeholder text that is shown in the query text field when no other text is present |
| Parameters |
|
| Returns |
|
| Source | extensions/chooser/libchooser.m line 331 |
| Signature | hs.chooser:query([queryString]) -> hs.chooser object or string |
|---|---|
| Type | Method |
| Description | Sets/gets the search string |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/chooser/libchooser.m line 290 |
| Signature | hs.chooser:queryChangedCallback([fn]) -> hs.chooser object |
|---|---|
| Type | Method |
| Description | Sets/clears a callback for when the search query changes |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/chooser/libchooser.m line 356 |
| Signature | hs.chooser:refreshChoicesCallback([reload]) -> hs.chooser object |
|---|---|
| Type | Method |
| Description | Refreshes the choices data from a callback |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/chooser/libchooser.m line 256 |
| Signature | hs.chooser:rightClickCallback([fn]) -> hs.chooser object |
|---|---|
| Type | Method |
| Description | Sets/clears a callback for right clicking on choices |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/chooser/libchooser.m line 386 |
| Signature | hs.chooser:rows([numRows]) -> hs.chooser object or number |
|---|---|
| Type | Method |
| Description | Gets/Sets the number of rows that will be shown |
| Parameters |
|
| Returns |
|
| Source | extensions/chooser/libchooser.m line 695 |
| Signature | hs.chooser:searchSubText([searchSubText]) -> hs.chooser object or boolean |
|---|---|
| Type | Method |
| Description | Gets/Sets whether the chooser should search in the sub-text of each item |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/chooser/libchooser.m line 621 |
| Signature | hs.chooser:select([row]) -> hs.chooser object |
|---|---|
| Type | Method |
| Description | Closes the chooser by selecting the specified row, or the currently selected row if not given |
| Parameters |
|
| Returns |
|
| Source | extensions/chooser/libchooser.m line 781 |
| Signature | hs.chooser:selectedRow([row]) -> number |
|---|---|
| Type | Method |
| Description | Get or set the currently selected row |
| Parameters |
|
| Returns |
|
| Source | extensions/chooser/libchooser.m line 729 |
| Signature | hs.chooser:selectedRowContents([row]) -> table |
|---|---|
| Type | Method |
| Description | Returns the contents of the currently selected or specified row |
| Parameters |
|
| Returns |
|
| Source | extensions/chooser/libchooser.m line 758 |
| Signature | hs.chooser:show([topLeftPoint]) -> hs.chooser object |
|---|---|
| Type | Method |
| Description | Displays the chooser |
| Parameters |
|
| Returns |
|
| Source | extensions/chooser/libchooser.m line 43 |
| Signature | hs.chooser:showCallback([fn]) -> hs.chooser object |
|---|---|
| Type | Method |
| Description | Sets/clears a callback for when the chooser window is shown |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/chooser/libchooser.m line 228 |
| Signature | hs.chooser:subTextColor(color) -> hs.chooser object or hs.color object |
|---|---|
| Type | Method |
| Description | Sets the sub-text color of the chooser |
| Parameters |
|
| Returns |
|
| Source | extensions/chooser/libchooser.m line 500 |
| Signature | hs.chooser:width([percent]) -> hs.chooser object or number |
|---|---|
| Type | Method |
| Description | Gets/Sets the width of the chooser |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/chooser/libchooser.m line 658 |