This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
action:While [2017/03/01 17:55] JMichaelTX Added section on Exiting the While Loop |
action:While [2020/07/16 21:19] JMichaelTX ADD block on looping actions |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== While Conditions Are Met Action ====== | ====== While Conditions Are Met Action ====== | ||
- | This _Action_ repeats a group of [[:Actions|Actions]] while the [[:Conditions|Conditions]] in the _While_ criteria are met. As soon as the _While_ Criteria is _not_ met, the _Action_ will exit the loop. | + | This _Action_ repeats a group of [[:Actions|Actions]] while the [[:Conditions|Conditions]] in the _While_ criteria are met. As soon as the _While_ Criteria is _not_ met, the _Action_ will exit the loop.\\ |
+ | It is one of several Actions that _loop_ through a set of other Actions until some criteria is met. | ||
+ | |||
+ | **Looping Actions** | ||
+ | |||
+ | * [[action:For_Each|For Each]] action | ||
+ | * [[action:Repeat|Repeat]] action | ||
+ | * [[action:Until|Until]] action | ||
+ | * [[action:While|While]] action | ||
**The _While_ Criteria can be any of these:** | **The _While_ Criteria can be any of these:** | ||
Line 13: | Line 22: | ||
**When you insert this _Action_ it appears like this:**\\ | **When you insert this _Action_ it appears like this:**\\ | ||
{{:action:while-conditions-action-km-7.3.png?nolink|}} | {{:action:while-conditions-action-km-7.3.png?nolink|}} | ||
- | |||
- | --- | ||
===== How To Setup ===== | ===== How To Setup ===== | ||
+ | |||
- Select one _While Criteria_ from the _While_ popup list.\\ (default is _all of the following is true_). | - Select one _While Criteria_ from the _While_ popup list.\\ (default is _all of the following is true_). | ||
- Add one or more new conditions by clicking the green + button next to the //New Condition// to see a popup menu of [[:Conditions|Conditions]]. | - Add one or more new conditions by clicking the green + button next to the //New Condition// to see a popup menu of [[:Conditions|Conditions]]. | ||
- Select one of these _Conditions_ and enter additional details as needed. | - Select one of these _Conditions_ and enter additional details as needed. | ||
- Insert one or more [[:Actions|Actions]] into the //No Action// area. | - Insert one or more [[:Actions|Actions]] into the //No Action// area. | ||
- | |||
- | --- | ||
===== Exiting the While Loop ===== | ===== Exiting the While Loop ===== | ||
Line 35: | Line 41: | ||
**THEN the loop will exit.** | **THEN the loop will exit.** | ||
- | --- | + | You can break out of the loop, retry this iteration, or skip to the next iteration with the [[actions:Redirect_Control_Flow|actions:Redirect Control Flow]] actions. |
===== Example ===== | ===== Example ===== | ||
{{:action:while.png?500|}} | {{:action:while.png?500|}} | ||
- | |||
- | --- | ||
===== Conditions ===== | ===== Conditions ===== | ||
+ | See the [[:Conditions|Conditions]] section for further details. | ||
- | [[:Conditions|Conditions]] are grouped by category. See the [[:Conditions|Conditions]] section for further details. | + | ~~NOCACHE~~ |
- | *Application | + | <nspages condition -textPages=""> |
- | *Button | + | |
- | *Calculation | + | |
- | *Clipboard | + | |
- | *Environment Variable | + | |
- | *[[condition:Found_Image|Found Image]] | + | |
- | *Key | + | |
- | *Location | + | |
- | *Macro/Macro Group | + | |
- | *Menu | + | |
- | *Modifiers | + | |
- | *Mounted Volume | + | |
- | *Path | + | |
- | *Pixel | + | |
- | *Script | + | |
- | *Text | + | |
- | *Typed String | + | |
- | *USB Device | + | |
- | *Variable | + | |
- | *Any Window | + | |
- | *Front Window | + | |
- | *Wireless Network | + | |
After selecting a condition category you can make further choices. For example, if you choose the //Application Condition// you can choose a specific application to be running, or at the front, and so on. | After selecting a condition category you can make further choices. For example, if you choose the //Application Condition// you can choose a specific application to be running, or at the front, and so on. | ||
Add further conditions by clicking the green + button again. | Add further conditions by clicking the green + button again. | ||
+ | |||
+ | You can break out of the loop, retry this iteration, or skip to the next iteration with the [[actions:Redirect_Control_Flow|actions:Redirect Control Flow]] actions. | ||
+ | |||
+ | ===== See Also ===== | ||
+ | |||
+ | === Actions === | ||
+ | |||
+ | * [[action:If Then Else|If Then Else]] action | ||
+ | * [[action:Pause_Until|Pause Until]] action | ||
+ | * [[action:For_Each|For Each]] action | ||
+ | * [[action:Repeat|Repeat]] action | ||
+ | * [[action:Until|Until]] action | ||
+ | * [[action:Assert|Assert]] action | ||
+ | * [[actions:Redirect_Control_Flow|Redirect Control Flow]] actions | ||
+ | * [[:Actions|See all Actions]] | ||
+ | |||
+ | === Conditions === | ||
+ | |||
+ | * [[:Conditions|See all Conditions]] | ||
+ | ==== Forum ==== | ||
+ | |||
+ | - [[https://forum.keyboardmaestro.com/t/issue-pause-until-action-fails-with-no-windows/3022/7|ISSUE: PAUSE UNTIL Action Fails with No Windows]] | ||
+ | |||
+ | - [[https://forum.keyboardmaestro.com/search?q=Until|Keyboard Maestro Forum topics about Until action]] | ||
+ |