# Notify, Twitter, Speak, and runCommand

#### Notify

notify(headline[,subtitle][,date] ) adds a notification to your computer’s notification center. Headline and an optional subtitle are displayed in the headline. If the optional date is supplied, the notification will be held until after that date and time; otherwise, the notification will appear immediately.

#### Twitter

####

twitter(screen name, status) will post a new status to your Twitter account. The screen name must have been registered in System Preferences:Internet Accounts.

#### Speak

.speak() will speak the value of any string value. For example:

> `$Text.speak()`

will speak the note’s text. An optional argument specifies the voice to use.

> `"Now is the winter of our discontent".speak("Tessa")`

will pronounce the string using the South African voice Tessa.

#### runCommand

The runCommand() function asks the operating system to start a new process and results the result of that process.

> `$Text = runCommand(command_line, input)`

runCommand() executes the specified command line in your default, passing it the the value input as its standard input. The standard output of the command, if any, is the value of the completed action. For example:

> `$Text = runCommand(ls ~/Documents)`

replaces the note’s text with a list of the files and folders in the user’s Documents folder, and

> `$Text |= runCommand("curl "+$URL)`

will – if the note has no text – ask curl to fetch whatever text is found at the url stored in the note’s $URL.

It is not necessary to use an attribute to hold the output from runCommand, allowing the operator to be used 'bare' in action code. If $CommandValue holds a valid command line string, this can be used in a rule or action:

`runCommand($CommandValue)`