The Switch Action is a good alternative to using multiple, nested, If/Then Actions.
The Switch parameter may be any of the following:
When you insert the Switch Action, it is configured to switch based on the System Clipboard, but can be easily changed to other parameters. It initially looks like this:
For each Condition that you add, you can enter zero or more Actions that will be executed when that Condition is met. After those Action(s) are executed, or if no Conditions are met, the Switch Action is exited.
See this Forum Topic for a downloadable example:
ACTION: Switch Case Based on FrontMost App
The Conditions available depend on the Parameter that is chosen:
The Conditions are defined as follows:
|has text||Clipboard has at least one item containing text of some sort.|
|does not have text||Clipboard does not have any text items.|
|has image||Clipboard has one or more images.|
|does not have image||Clipboard does not have any images.|
|is||is exactly (case insensitive) the specified string.|
|is not||is not exactly (case insensitive) the specified string.|
|is before||is alphabetically before the specified string. (v7.2+)|
|is after||is alphabetically after the specified string. (v7.2+)|
|contains||contains (case insensitive) the specified string.|
|does not contain||does not contain (case insensitive) the specified string.|
|matches||matches the specified regular expression.|
|does not match||does not match the specified regular expression.|
|conforms to||Clipboard has an item with the UTI class that conforms to the specified Uniform Type Identifier.|
|does not conform to||Clipboard does not have an item with the UTI class that conforms to the specified Uniform Type Identifier.|
|otherwise||will execute if none of the Conditions in the Switch, that are entered above otherwise, are met.|
The Otherwise Condition will execute if none of the above Conditions are met. The Switch Action will then exit. So, the Otherwise Condition should always be placed as the last Condition in the Switch Action.