Alphred
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download

Namespaces

  • Alphred
  • None

Classes

  • Alfred
  • AppleScript
  • Choose
  • Config
  • Date
  • Dialog
  • Filter
  • Globals
  • i18n
  • Ini
  • Keychain
  • Log
  • Notification
  • Request
  • Result
  • ScriptFilter
  • Text

Interfaces

  • ConfigKeyNotSet
  • Exception
  • FileDoesNotExist
  • InvalidKeychainAccount
  • InvalidScriptFilterArgument
  • InvalidSecurityAction
  • InvalidXMLProperty
  • PasswordExists
  • PasswordNotFound
  • PluginFunctionNotFound
  • RunningOutsideOfAlfred
  • ShouldBeBool
  • TooManyArguments
  • UnknownSecurityException
  • UseOnlyAsStatic

Class ScriptFilter

Creates Script Filter XML for Alfred

Example usage:

<pre><span class="php-var">$script_filter</span> = <span class="php-keyword1">new</span> Alphred\ScriptFilter( [<span class="php-quote">'error_on_empty'</span>] =&gt; <span class="php-keyword1">true</span> ); <span class="php-var">$script_filter</span>-&gt;add_result( <span class="php-keyword1">new</span> Alphred\Result([ <span class="php-quote">'title'</span> =&gt; <span class="php-quote">'This is a title'</span>, <span class="php-quote">'subtitle'</span> =&gt; <span class="php-quote">'This is a subtitle'</span>, <span class="php-quote">'valid'</span> =&gt; <span class="php-keyword1">false</span> ])); <span class="php-var">$script_filter</span>-&gt;to_xml();</pre>

Namespace: Alphred
Since: 1.0.0
Uses: Alphred\Result Result items are stored in the script filter
Located at ScriptFilter.php

Methods summary

public
# __construct( array $options = [] )

Constructs a script filter container

Constructs a script filter container

Parameters

$options
specify options:... see>>>?

Since

1.0.0
private
# initializei18n( )

Initializes a i18n Alphred object to use internally

Initializes a i18n Alphred object to use internally

Since

1.0.0

See

Alphred\i18n
private string
# translate( string $string )

Translates a string using the i18n class

Translates a string using the i18n class

Parameters

$string
a string to translate

Returns

string
the string, translated if possible

Since

1.0.0

See

Alphred\i18n
public
# add_result( Alphred\Result $result )

Adds a result into the script filter

Adds a result into the script filter

Parameters

$result
an Alphred\Result object

Since

1.0.0

See

Alphred\Result
public array
# get_results( )

Returns an array of the results

Returns an array of the results

Returns

array
an array of the current result items

Since

1.0.0
public
# print_results( )

Alias of to_xml()

Alias of to_xml()

Since

1.0.0

See

Alphred\ScriptFilter::to_xml()
public
# to_xml( )

Outputs the script filter in Alfred XML

Outputs the script filter in Alfred XML

Since

1.0.0
private
# write_item( object $item )

Writes out the Alfred XML

Writes out the Alfred XML

Parameters

$item
An \Alphred\Result object

Since

1.0.0

Magic methods summary

Alphred API documentation generated by ApiGen