condition precedent
Addon [SkQuery] will apply it
[command] to be defined in [ontab complete]
[command] is positioned to be recognized higher than [on tab complete]
As a result, factor 1 factor 2 appears as a tab after hitting the command and entering the space bar.
If you enter factor 1, factor 1 factor 2 does not appear in the tab by condition, and factor 3 appears new.
If you subsequently populate argument 3, a new factor 4 appears.
When factor 2 is entered, factor 1 factor 2 does not appear on the tab by condition {argument::*} The predefined children of the array appear on the tab.
Addon [SkQuery] will apply it
[command] to be defined in [ontab complete]
[command] is positioned to be recognized higher than [on tab complete]
Code:
on tab completer for "/command":
@if argument at 1 is not "factor1" or "factor2":
@@add "factor1" to tab completions
@@add "factor2" to tab completions
@if argument at 1 contains "factor1":
@@if argument at 2 is "": # If the argument corresponding to factor 3 is empty
@@@add "factor3" to tab completions
@@if argument at 3 is set: # if argument corresponding to factor 3 is populated
@@@if argument at 4 is "": # If the argument corresponding to factor 4 is empty
@@@@add "factor4" to tab completions
@if argument at 1 contains "factor2":
@@loop {argument::*}:
@@@set {_a} to loop-value
@@@add loop-value to tab completions
As a result, factor 1 factor 2 appears as a tab after hitting the command and entering the space bar.
If you enter factor 1, factor 1 factor 2 does not appear in the tab by condition, and factor 3 appears new.
If you subsequently populate argument 3, a new factor 4 appears.
When factor 2 is entered, factor 1 factor 2 does not appear on the tab by condition {argument::*} The predefined children of the array appear on the tab.