# New/Edit FilterFilter KindScript plug-in

- Note: this window is only included in the standard edition of Simon, not Simon Express and Simon Free. Learn more...

The Script plug-in is displayed when you choose Script in the Filter Kind pop-up menu in the New / Edit Filter window.

This plug-in can be used to create custom filters that use an AppleScript, shell script, or Perl, PHP, Python, etc script.

Description: The text area just below the Filter Kind pop-up menu is where you can enter a brief description of the filter. This text is displayed in the New / Edit Test window.

Custom Variables: This table allows adding new variables to the Insert variable drop-down menu. These variables also appear as fields in the New / Edit Test window. Click the button to add a line to the table, or the button to remove the selected line. You'd typically use this to ask for text to look for, or other custom information needed by the script.

Custom Error Descriptions: This table serves two purposes. Firstly, you can edit the Result column value for the Success line to indicate which result number means the script executed successfully — it is normally zero, but you can change it to something else if appropriate. Secondly, you can give more meaningful descriptions to the error result values; these will appear in the Failures table. Click the button to add a line to the table, or the button to remove the selected line.

Always use this result for the status: If this checkbox is on, the result of the script will be used for the filter status regardless of the status from the service and any previous filters. If off, the result will be used if "more interesting" than the old status — i.e. a failure will be used if previously successful, a change will be used if not a failure or already changed, and unchanged will only be used if previously unchanged. This is the normal behavior of the filters, but it can be useful to override previous filters.

Insert variable: Variables are markers in the text that are replaced by another value when the filter is used. Use this menu to choose from the available variables. When one is chosen, it is inserted at the insertion point, or replaces the selected text. Refer to the Variables page for descriptions of the available variables.

Script type: Choose the type of script in this combo box. You can type the name, or click the menu on the right-hand side to display the available options. It displays the name of the tool, and its path. You can also specify a tool not listed by typing its path, but if you might want to use it again, you can add it to the default list via the Script Preferences.

Script editor: Write your script here. You can insert variables like those shown between braces. See the Insert variable item above, or expert users can type them directly. You can change the font, size, and colors of this text area in the Script Preferences.

Click this button to try out the script. Simon will display a Preview window, displaying the source at the top and the output at the bottom, along with the result. Note that default values will be used for the variables; add a test for this filter to use real variable values.

This button is only available when the Script type is AppleScript. It builds the script, and displays any AppleScript errors. If valid, the script is colored as conventional for AppleScripts.

Get More: Click this button to visit the Simon Extras page in your web browser. It is the repository for new and user-submitted scripts and more.

Open Script...: Click to load a new script off disk, replacing any already in the window. It could be a standard .scpt, .sh, etc file, or one saved from Simon.

Save Script As...: Click to save the current script, along with the instructions, custom variables, etc to a normal script file. Use this to share your scripts with other Simon users!

## Related Topics

- Filter Variables
- Script-based filters
- Monitor Failures log
- Filter Kind
- New / Edit Filter window