This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
action:Switch_or_Case [2017/06/21 21:53] JMichaelTX Add link to example |
action:Switch_or_Case [2017/09/07 01:51] peternlewis |
||
---|---|---|---|
Line 1: | Line 1: | ||
{{:action:switch-icon.png?nolink|}} | {{:action:switch-icon.png?nolink|}} | ||
- | ====== Switch or Case Action ====== | + | ====== Switch/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 [[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch|JavaScript Switch]] statement. | + | **The //Switch/Case action// is used to perform different actions based on different values of a common _parameter_.** It is very similar to the [[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch|JavaScript Switch]] statement. |
The _Switch_ Action is a good alternative to using multiple, nested, [[action:If_Then_Else|If/Then]] Actions. | The _Switch_ Action is a good alternative to using multiple, nested, [[action:If_Then_Else|If/Then]] Actions. | ||
- | |||
- | ---- | ||
===== Parameters ===== | ===== Parameters ===== | ||
Line 15: | Line 13: | ||
* [[:Variables|Keyboard Maestro Variable]] | * [[:Variables|Keyboard Maestro Variable]] | ||
* Text (which can use [[:Tokens|Tokens]]) | * Text (which can use [[:Tokens|Tokens]]) | ||
- | |||
- | ---- | ||
- | |||
===== Default Configuration ===== | ===== Default Configuration ===== | ||
Line 31: | Line 26: | ||
See this Forum Topic for a downloadable example:\\ | See this Forum Topic for a downloadable example:\\ | ||
[ACTION: Switch Case Based on FrontMost App](https://forum.keyboardmaestro.com/t/action-switch-case-based-on-frontmost-app/7294) | [ACTION: Switch Case Based on FrontMost App](https://forum.keyboardmaestro.com/t/action-switch-case-based-on-frontmost-app/7294) | ||
- | |||
- | --- | ||
- | |||
===== Conditions ===== | ===== Conditions ===== | ||
Line 66: | Line 58: | ||
===== See Also ===== | ===== See Also ===== | ||
- | |||
- | ---- | ||
=== Actions === | === Actions === | ||
* [[action:If Then Else|If Then Else]] | * [[action:If Then Else|If Then Else]] | ||
- | * [[action:Pause|Pause Until Conditions Met]] | + | * [[action:Pause_Until|Pause Until Conditions Met]] |
* [[action:Until|Execute Action Until Conditions Met]] | * [[action:Until|Execute Action Until Conditions Met]] | ||
* [[action:While|Execute Action While Conditions Met]] | * [[action:While|Execute Action While Conditions Met]] | ||
Line 80: | Line 70: | ||
* [[:Conditions|See all Conditions]] | * [[:Conditions|See all Conditions]] | ||
- | |||
- | ---- | ||
==== Forum ==== | ==== Forum ==== |