User Tools

Site Tools


action:Switch_or_Case

**This is an old revision of the document!**

Switch or Case Action

The Switch or Case action is used to perform different actions based on different values of a common parameter. It is very similar to the JavaScript Switch statement.

The Switch Action is a good alternative to using multiple, nested, If/Then Actions.


Parameters

The Switch parameter may be any of the following:


Default Configuration

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.


Conditions

The Condition can be and of the following:

  • has text of some sort.
  • does not have text.
  • has an image of some sort.
  • does not have an image.
  • is exactly (case insensitively) a specified string.
  • is not exactly (case insensitively) a specified string.
  • is alphabetically before a specified string. (v7.2+)
  • is alphabetically after a specified string. (v7.2+)
  • contains (case insensitively) a specified string.
  • does not contain (case insensitively) a specified string.
  • matches a specified regular expression.
  • does not match a specified regular expression.
  • has some flavor that conforms to the specified Uniform Type Identifier.
  • does not have a flavor that conforms to the specified Uniform Type Identifier.
  • otherwise (aka always).

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.


See Also


Actions

Conditions

Forum

action/Switch_or_Case.1480288521.txt.gz · Last modified: 2016/11/27 18:15 by JMichaelTX