Download the PHP package skyzyx/alfred-workflow-builder without Composer
On this page you can find all versions of the php package skyzyx/alfred-workflow-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download skyzyx/alfred-workflow-builder
More information about skyzyx/alfred-workflow-builder
Files in skyzyx/alfred-workflow-builder
Package alfred-workflow-builder
Short Description Workflow Builder for Alfred 2
License MIT
Homepage https://github.com/skyzyx/alfred-workflow-builder
Informations about the package alfred-workflow-builder
Alfred Workflow Builder
Alfred Workflow Builder is a PHP class for creating workflows with Alfred 2. This class provides functions for working with plist settings files, reading and writing data to files, generating Alfred feedback results, and more.
Installation
Composer is the recommended way to install is package. Composer is dependency management tool for PHP that allows you to declare the dependencies your project needs and installs them into your project.
-
Add
skyzyx/alfred-workflow-builder
as a dependency in your project'scomposer.json
file. -
Download and install Composer.
-
Install your dependencies.
- Require Composer's autoloader. Composer also prepares an autoload file that's capable of autoloading all of the classes in any of the libraries that it downloads. To use it, just add the following line to your code's bootstrap process.
The original version of this class (written by David Ferguson) had methods for things like caching data to local files and fetching remote data over HTTP. Instead, we recommend you use Guzzle, Requests or Buzz for HTTP requests and Doctrine Cache for local file system caching. If you'd also like logging, we recommend Monolog.
Alfred\Workflow
string
toXML()
Accepts a properly formatted array or json object and converts it to XML for creating Alfred feedback results. If results
have been created using the result()
function, then passing no arguments will use the array of results created using
the result()
function.
Example using result function
Example using array
Result
array
mdfind()
Executes an mdfind
command and returns results as an array of matching files.
You can learn more about querying the OS X metadata service by checking out:
- Using Spotlight from the OS X Commandline
- File Metadata Query Expression Syntax
- Spotlight Metadata Attributes
array
result()
Creates a new result item that is cached within the class object. This set of results is available via the results()
functions, or, can be formatted and returned as XML via the toXML()
function.
Key | Usage |
---|---|
uid |
Unique ID for the search result. (Required) |
arg |
Argument for this result. This will get fed into any downstream actions. (Required) |
title |
The main title for the result. (Required) |
subtitle |
The subtitle for the result. (Required) |
icon |
The icon that this result should have. This should typically be |
valid |
If you press enter with this result selected, should it trigger downstream actions? Valid values are
|
autocomplete |
If you press enter with this result selected, what value should pop up as an autocomplete value? (Movies is a good usage example.) |
Example
Result
Alfred\Storage\Plist
string
setValue()
Stores a key-value pair.
string
setValues()
Stores a series of key-value pairs.
string
getValue()
Retrieves the value of a key.
More!
You can learn more about Alfred 2 Workflows by checking out http://support.alfredapp.com/workflows.
You can also deconstruct some workflows that are built with Alfred Workflow Builder.
All versions of alfred-workflow-builder with dependencies
seld/jsonlint Version >= 1.1
symfony/filesystem Version 2.*
symfony/process Version 2.*