User Tools

Site Tools


action:Switch_or_Case

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
action:Switch_or_Case [2017/09/07 01:51]
peternlewis
action:Switch_or_Case [2021/10/15 01:20]
peternlewis
Line 1: Line 1:
-{{:​action:​switch-icon.png?​nolink|}} 
 ====== Switch/Case Action ====== ====== Switch/Case Action ======
  
-**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/​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.
Line 8: Line 7:
 ===== Parameters ===== ===== Parameters =====
  
-**The Switch _parameter_ may be any of the following:**+The Switch _parameter_ may be any of the following:
   * [[:​Clipboards|System Clipboard]]   * [[:​Clipboards|System Clipboard]]
   * [[:​Clipboards#​Named_Clipboards|Named Clipboard]]   * [[:​Clipboards#​Named_Clipboards|Named Clipboard]]
-  * [[:​Variables|Keyboard Maestro Variable]]+  * [[manual:​Variables|Keyboard Maestro Variable]]
   * Text (which can use [[:​Tokens|Tokens]])   * Text (which can use [[:​Tokens|Tokens]])
  
Line 21: Line 20:
  
 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. 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.
- 
----- 
-===== 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) 
  
 ===== Conditions ===== ===== Conditions =====
Line 73: Line 67:
 ==== Forum ==== ==== Forum ====
  
 +- [[https://​forum.keyboardmaestro.com/​t/​action-switch-case-based-on-frontmost-app/​7294|ACTION:​ Switch Case Based on FrontMost App]]
 - [[https://​forum.keyboardmaestro.com/​search?​q=Switch%20action|Keyboard Maestro Forum topics about Switch or Case action]] - [[https://​forum.keyboardmaestro.com/​search?​q=Switch%20action|Keyboard Maestro Forum topics about Switch or Case action]]
  
action/Switch_or_Case.txt ยท Last modified: 2022/09/17 22:49 by peternlewis