Using Rules

How Rules Work

The manner in which rules work is borrowed from the world of email clients. A rule contains the following:

Here are a few examples of rules I might set up:

Of course, your rules are probably a lot more practical. If there are things that you'd like to do with the rules mechanism that it doesn't allow, by all means, send in your suggestions.

Setting Up Rules

You access the rules editor through preferences. From there, you can add, delete, and edit existing rules. Use the checkboxes next to a rule's name to turn it on and off.

Rules are evaluated in the order they appear in the Preferences. To change the order, just drag a rule up or down in the list.

Running Shell Commands From Rules

Note: This is a feature for advanced users. Be careful what you run!

You can run arbitrary shell commands via rules with the "Run Shell Command" action. The following variables are available:

$TITLE
The title of the entry, quoted and escaped.
$BODY
The textual body content of the entry, quoted and escaped (e.g. a text entry returns its unformatted text, a bookmark entry the associated URL, a PDF returns the plaintext contents of the document, if any)
$CREATED
The time/date the entry was created, as a UNIX timestamp
$TYPE
The entry's type (e.g. text, pdf, webarchive)
$FLAGGED
0 or 1 indicating whether or not the entry is flagged.
$LABEL
A number 0-8 indicating the entry's label. 0 means no label.

If an error is encountered during the execution of the command, ShoveBox will stop evaluating rules and display an alert.