Struct rusty_alfred::AlfredItem [] [src]

pub struct AlfredItem {
    pub uid: Option<String>,
    pub title: String,
    pub subtitle: Option<String>,
    pub arg: Option<String>,
    pub icon: Option<AlfredItemIcon>,
    pub valid: Option<bool>,
    pub autocomplete: Option<String>,
    pub item_type: Option<AlfredItemType>,
    pub item_mods: Option<AlfredItemMods>,
    pub text: Option<AlfredItemText>,
    pub quicklookurl: Option<String>,
}

An item to be displayed in Alfred. Only the title attribute is required.

Documentation mostly copied from here.

Fields

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.

The title displayed in the result row. There are no options for this element and it is essential that this element is populated.

The subtitle displayed in the result row. This element is optional.

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

While the arg 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.

The icon displayed in the result row. Workflows are run from their workflow folder, so you can reference icons stored in your workflow relatively.

See the documentation for AlfredItemIcon for more information.

If 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.

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).

If the item is set as "valid": false, the auto-complete text is populated into Alfred's search field when the user actions the result.

The type of item. See the documentation for AlfredItemType for more information.

The mod element gives you control over how the modifier keys react. See the documentation for AlfredItemMods for more information.

The text element defines the text the user will get when copying the selected result row with ⌘C or displaying large type with ⌘L. See the AlfredItemText documentation for more information.

A Quick Look URL which will be visible if the user uses the Quick Look feature within Alfred (tapping shift, or cmd+y)

Methods

impl AlfredItem
[src]

Makes a new item with a title.

Use the builder methods to customize the item more.

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.

The title displayed in the result row. There are no options for this element and it is essential that this element is populated.

The subtitle displayed in the result row. This element is optional.

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

While the arg 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.

The icon displayed in the result row. Workflows are run from their workflow folder, so you can reference icons stored in your workflow relatively.

See the documentation for AlfredItemIcon for more information.

If 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.

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).

If the item is set as "valid": false, the auto-complete text is populated into Alfred's search field when the user actions the result.

The type of item. See the documentation for AlfredItemType for more information.

The text element defines the text the user will get when copying the selected result row with ⌘C or displaying large type with ⌘L. See the AlfredItemText documentation for more information.

Builder method to set the text field for this item.

A Quick Look URL which will be visible if the user uses the Quick Look feature within Alfred (tapping shift, or cmd+y)

Trait Implementations

impl Debug for AlfredItem
[src]

Formats the value using the given formatter.

impl PartialEq for AlfredItem
[src]

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

This method tests for !=.

impl Hash for AlfredItem
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more