Custom cleaners allow you to create your own customized text processing solutions.
The Custom Cleaner Editor provides access to the library of user created cleaners. Here is a quick overview.
The Custom Cleaner Editor provides access to the custom cleaners in your library. The editor is split into three main panes.
The top section of this pane lists each cleaner in your library. Subroutines are listed under their parent cleaners. Click the disclosure triangle to reveal any subroutines of a cleaner. If the cleaner does not have a disclosure triangle, it does not have any additional subroutines.
The bottom section of the pane displays the properties of the selected cleaner. These include:
The note shows up as a tooltip in the cleaner list drawer.
The center pane holds the list of actions that constitute your cleaner. Each action performs a discrete task on your text.
Drag an action item from the Action List (right pane) to add it to the custom cleaner. Drag the action within the work area to rearrange the order of the actions.
When you are done editing the action, click on the disclosure triangle of the action to collapse it and reduce space.
The right pane is split into two tabs. The left tab (Actions) displays the list of actions that can be added to a custom cleaner. The right tab (Regex Help) displays a quick reference to use when working with regular expressions.
The list of actions displays the name of the action along with its description. Click the ( ) icon to toggle including the descriptions in the list. You can also use the search bar to filter down the list of actions.
Drag the action item into the work area to add it to your custom cleaner.
TextSoap supports regular expressions in actions that find text. The syntax used in these expressions can be complex and involved. TextSoap provides a quick reference of the character sequences used in writing these expressions.
Note: This quick reference is not meant as a definitive guide.
Click the Preview cleaner ( ) to test your cleaner. TextSoap works on a copy of the text in the Clipboard Workspace to perform the preview.
Click the Preview cleaner button again to dismiss the Preview window and return to the Custom Cleaner Editor.
Subroutines are collections of ordered actions within a custom cleaner.
You can only call a subroutine from within the cleaner it belongs to. A subroutine cannot be directly called from another cleaner.
Click the ( ) button and select "Add Subroutine" to add a subroutine to the selected cleaner.
Click on its name and edit it to rename the subroutine.
Select the subroutine name to display its list of actions in the Work Area. Use the "Call Subroutine", "Find Text and Call Subroutine", or "Find Style and Call Subroutine" actions to access and call a subroutine.
Control-click on the cleaner names to choose the shortcut menu command to add or delete a subroutine.
Open an existing custom cleaner in TextSoap to import it.
Select the cleaner name in the Custom Cleaner Editor and choose the "Export" action menu command. Follow the prompts to save the custom cleaner to disk.
TextSoap 6 custom cleaners use the ".tscleaner" extension. TextSoap 5 custom cleaners use the ".ccleaner" extension.
Use this action to apply an existing cleaner to the selected text. Custom cleaners can call other cleaners (including other custom cleaners) to do more work. The cleaner specified can be any built-in cleaner or custom cleaner. TextSoap treats both built-in and custom cleaners in the same way.
Note: If the cleaner cannot be found while performing the actions, this action is ignored.
Use this action to find a text and replace the found text.
Select "Textual" from the pop-up menu to find standard text. The following meta-characters are supported when using Textual searches:
\\ backslash (\) character
\r traditional carriage return character
\n newline character
\t tab character
\x{HHHH} Char with unicode hex value: {HHHH}
Select "Regular Expression" from the pop-up menu to use the regex syntax. See the "Regular Expressions" topic.
Select "Ignore Case" if you wish to match text regardless of case.
Use this action to find and replace a large collection of text items.
Use this action to search for N or more occurrences of the same character and replace it with a specific value. The search is only for one character, but meta-characters are supported. See "Find and Replace Text" under Textual searches.
For example, specify two or more "\t", the action will match tab tab or tab tab tab and so forth.
Use this action to provide a customized alternative to the "Capitalize With Title Case" cleaner.
Use this action to rewrap the text at the specified number of characters. Text is word wrapped to fit within the specfied character width.
Use this action to quote text. Specify the:
Note: The text wrap value is reduced by the number of characters used for quoting.
Use this action to insert a larger amount of text before or after the text.
Use this action to specify text to place before and after selected text. A common use is for applying HTML tags.
Example:
Specify the before tag as "<custom>" and the after tag as "</custom>".
Select a word like "this" and apply the cleaner.
"this" becomes "<custom>this</custom>".
The HTML and PLIST tag cleaners are examples of this type of cleaner action.
Use this action to specify which direction you wish to sort the lines.
Use this action to add a prefix to the beginning of each line.
Use this action to add a suffix to the end of each line.
Use this action to remove a specific prefix (if it exists) from the beginning of each line.
Use this action to remove a specific suffix (if it exists) from the end of each line.
Use this action to extract text using a regular expression.
The default behavior replaces the existing text with the extracted text. Select "Append Result" to append the resulting text to the end of the original.
Use this action to find text and apply a style to it.
If a style attribute is not checked, the text will be unchanged.
When specifying size, choose absolute (Abs) from the pop-up menu to specify an exact font size. Choose the Increase (+) or Decrease (-) pop-up menu to relatively increase or decrease the font size.
This action finds text based on a set of font attributes and applies a cleaner to the found text.
Exact font specifies the exact font name, for example: AmericanTypewriter-CondensedBold. Use this when you are looking for traits such as condensed, which can't be found with the current family or typeface options.
Specify multiple sizes with a comma separated list (e.g. 12,14,16,24). You can also specify a range of sizes (e.g. 12,14-18,24).
See: Find a Style and Call Subroutine
Use this action to apply font, size and color attributes to text.
The size attribute can be specified in either either absolute size or a relative sizing. See Find Text and Apply Style
This action finds text and then applies another cleaner to that found text. Use this to create more complex cleaner actions. It is useful for applying the built-in cleaners to portions of the provided text.
If you have multiple custom cleaners working together, you may want to use subroutines to combine them into a single cleaner.
See: Find Text and Call Subroutine
Use this action to find text based on a style and then tag the found text.
For example, you can find bolded text and then tag it with <B>/</B>
Use this action to find text of one style and optionally replace the attributes of the text.
See: Find Style and Apply Cleaner, Set Style
Use this action to perform the actions in another subroutine within the current cleaner.
See: Apply Cleaner
Use this action to find text and then perform the actions in a subroutine within the current cleaner.
See: Find Text and Apply Cleaner
Use this action to find text based on its style attributes and then perform the actions in a subroutine within the current cleaner.
See: Find Style and Apply Cleaner