The TerminalNotifier Wrapper

This page is a simple introduction into using the TerminalNotifier wrappers supplied in The Alfred Bundler.
Although they are not shown here, there are other parameters that the wrapper can accept. To see the full documentation of the TerminalNotifier wrappers please see the TerminalNotifier Reference page.


In order for you to use the wrappers, you must already have initialized an object for the bundler. For instructions on how to initialize the bundler please see the PHP, Python, or Ruby quickstart pages.

Initializing The Client

PHP
Python
Ruby
$client = $bundler->wrapper('terminalnotifier')

If you wish to enabled debugging, set the debug parameter to true.

$client = $bundler->wrapper('terminalnotifier', $debug=true)
client = bundler.wrapper('terminalnotifier')

If you wish to enabled debugging, set the debug parameter to true.

client = bundler.wrapper('terminalnotifier', debug=True)
@client = @bundler.wrapper('terminalnotifier')

If you wish to enabled debugging, set the debug parameter to true.

@client = @bundler.wrapper('terminalnotifier', debug=true)

Spawning Notifications

Creating cool MacOSX notifications is extremely easy using the Terminal Notifier wrappers. Simply call the notify function with acceptable parameters.

Keep in mind that notifications do not return any values. So any variable that catches the return of the notification call will recieve a null value.

PHP
Python
Ruby
$client->notify([
    'title'=>'My Notification',
    'subtitle'=>'Here is a subtitle',
    'message'=>'Your message goes here',
    'sender'=>'com.runningwithcrayons.Alfred-2'
]);
client.notify(
    title='My Notification',
    subtitle='Here is a subtitle',
    message='Your message goes here',
    sender='com.runningwithcrayons.Alfred-2'
)
@client.notify(
    title:'My Notification',
    subtitle:'Here is a subtitle',
    message:'Your message goes here',
    sender:'com.runningwithcrayons.Alfred-2'
)