action:Switch_or_Case
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| action:Switch_or_Case [2015/07/15 08:58] – created peternlewis | action:Switch_or_Case [2022/09/18 02:49] (current) – [Switch/Case Action] peternlewis | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | The //Switch or Case action// lets you read a string from the System Clipboard, from a Named Clipboard, from a variable, or from a file and then match it against various other strings to choose which set of actions to do. | + | ====== Switch/Case Action ====== |
| - | The action | + | The // |
| - | The condition can test the source and see if: | + | The _Switch_ Action is a good alternative to using multiple, nested, [[action:If_Then_Else|If/ |
| - | * has text of some sort. | + | The actions in the first section that matches will be executed. If no section |
| - | * 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. | + | |
| - | * contains (case insensitively) a specified string. | + | |
| - | * does not contain (case insensitively) a specified string. | + | |
| - | * matches | + | |
| - | * does not match a specified regular expression. | + | |
| - | * has some flavor that conforms to the specified [Uniform Type Identifier](https: | + | |
| - | * does not have a flavor that conforms | + | |
| - | * otherwise (aka always). | + | |
| - | In all cases at most one sequence | + | ===== Parameters ===== |
| + | |||
| + | The Switch _parameter_ may be any of the following: | ||
| + | * [[: | ||
| + | * [[: | ||
| + | * [[token: | ||
| + | * [[manual: | ||
| + | * Text (which can use [[: | ||
| + | * [[manual: | ||
| + | * File | ||
| + | |||
| + | ===== 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. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | 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 _Conditions_ available depend on the _Parameter_ that is chosen (for example, you cannot use *has an image* with a calculation). | ||
| + | |||
| + | The _Conditions_ are defined as follows: | ||
| + | |||
| + | ^Condition^Definition^ | ||
| + | |is empty|The text is contains no characters.| | ||
| + | |is not empty|The text is contains some characters.| | ||
| + | |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.| | ||
| + | |contains |contains (case insensitive) the specified string.| | ||
| + | |does not contain |does not contain (case insensitive) the specified string.| | ||
| + | |starts with |starts with the specified string.| | ||
| + | |ends with |ends with the specified string.| | ||
| + | |is before |is alphabetically before the specified string. (v7.2+)| | ||
| + | |is after |is alphabetically after the specified string. (v7.2+)| | ||
| + | |matches |matches the specified regular expression.| | ||
| + | |does not match |does not match the specified regular expression.| | ||
| + | |is <|is numerically less than.| | ||
| + | |is <=|is numerically less than or equal.| | ||
| + | |is =|is numerically equal.| | ||
| + | |is >=|is numerically greater than or equal.| | ||
| + | |is >|is numerically greater than.| | ||
| + | |is !=|is numerically not equal.| | ||
| + | |conforms to |Clipboard has an item with the UTI class that conforms to the specified [Uniform Type Identifier](https:// | ||
| + | |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 | ||
| + | |||
| + | |||
| + | The _Otherwise_ _Condition_ | ||
| + | |||
| + | ===== See Also ===== | ||
| + | |||
| + | === Actions === | ||
| + | |||
| + | * [[action:If Then Else|If Then Else]] | ||
| + | * [[action: | ||
| + | * [[action: | ||
| + | * [[action: | ||
| + | * [[: | ||
| + | |||
| + | === Conditions === | ||
| + | |||
| + | * [[: | ||
| + | |||
| + | ==== Forum ==== | ||
| + | |||
| + | - [[https:// | ||
| + | - [[https:// | ||
action/Switch_or_Case.1436950706.txt.gz · Last modified: by peternlewis
