pub struct Item { /* private fields */ }
Expand description

An Alfred script filter item.

Implementations

Create a new item with the provided title.

Set the subtitle for this item.

Set the UID for this item.

This is a unique identifier for the item which allows help Alfred to learn about this item for subsequent sorting and ordering of the user’s actioned results.

It is important that you use the same UID throughout subsequent executions of your script to take advantage of Alfred’s knowledge and sorting. If you would like Alfred to always show the results in the order you return them from your script, exclude the UID field.

Set the argument which is passed through the workflow to the connected output action.

While this attribute is optional, it’s highly recommended that you populate this as it’s the string which is passed to your connected output actions. If excluded, you won’t know which result item the user has selected.

Set the icon displayed in the result row.

Workflows are run from their workflow folder, so you can reference icons stored in your workflow relatively.

Set whether this item is valid or not.

If an item is valid then Alfred will action this item when the user presses return. If the item is not valid, Alfred will do nothing. This allows you to intelligently prevent Alfred from actioning a result based on the current query passed into your script.

If you exclude the valid attribute, Alfred assumes that your item is valid.

Set the text that Alfred will match against.

This field enables you to define what Alfred matches against when the workflow is set to “Alfred Filters Results”. If match is present, it fully replaces matching on the title property.

Note that the match field is always treated as case insensitive, and intelligently treated as diacritic insensitive. If the search query contains a diacritic, the match becomes diacritic sensitive.

Set the autocomplete value for this item.

An optional but recommended string you can provide which is populated into Alfred’s search field if the user auto-complete’s the selected result (⇥ by default).

Set the type of item.

Set the text the user will get when copying the selected result row with ⌘C or displaying large type with ⌘L.

If these are not defined, you will inherit Alfred’s standard behaviour where the arg is copied to the Clipboard or used for Large Type.

Set the text the user will get when displaying large type with ⌘L.

If this is not defined, you will inherit Alfred’s standard behaviour where the arg is used for Large Type.

Set the Quick Look URL for the item.

This will be visible if the user uses the Quick Look feature within Alfred (tapping shift, or ⌘Y). This field will also accept a file path, both absolute and relative to home using ~/.

If absent, Alfred will attempt to use the arg as the quicklook URL.

Add a modifier key configuration.

This gives you control over how the modifier keys react. For example you can define the valid attribute to mark if the result is valid based on the modifier selection and set a different arg to be passed out if actioned with the modifier.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.