Alfred v0.3.1 Alfred.Result View Source
Represents a result to be displayed in an Alfred search list.
Every result is required to have a title and a subtitle. Beyond this, there are many optional attributes that are helpful in various scenarios:
:arg
(recommended) — Text that is passed to connected output actions in workflows:autocomplete
(recommended) — Text which is populated into Alfred's search field if the user autocompletes the result:quicklookurl
— URL which will be visible if the user uses the Quick Look feature:uid
— Used to track an item across invocations so that Alfred can do its frecency sorting:valid
— Whenfalse
it means that the result cannot be selected
Link to this section Summary
Functions
Creates a new generic result
Creates a new URL result
Converts the results to the expected JSON output format
Link to this section Types
Link to this section Functions
Creates a new generic result.
Examples
Basic result:
iex> Alfred.Result.new("title", "subtitle")
%Alfred.Result{subtitle: "subtitle", title: "title"}
Result with some optional attributes:
iex> Alfred.Result.new("title", "subtitle", arg: "output", valid: false, uid: "test")
%Alfred.Result{arg: "output", subtitle: "subtitle", title: "title", uid: "test", valid: false}
Creates a new URL result.
Examples
Basic URL result:
iex> Alfred.Result.new_url("title", "http://www.example.com")
%Alfred.Result{arg: "http://www.example.com", autocomplete: "title",
quicklookurl: "http://www.example.com", subtitle: "http://www.example.com", title: "title",
uid: "http://www.example.com", valid: nil}
Converts the results to the expected JSON output format.