These 2 macros allow creation and management of a fully configurable MENU: one for updating and customizing it (called MenuUpdt), the other one for everyday use of this MENU (called Menu).
The MENU is based on a simple unique 2-level dictionary (global variable) where the 1st level contains the name of every submenu and the 2nd level contains every line of each submenu (the main menu name -1st entry- is 0 and it must not be changed).
Structure and syntax of 2nd level elements:
• Key=[Sort number][Action ID]>[String] where
- [Sort number] is a 2-digit number to allow menu items ordering
- [Action ID] 1 character or a number (see below)
- ">" separator character (mandatory)
- [String] is the text to be executed according to alphabetical Action IDs (package, submenu or macro name, URL...)
• Value (string type)=text displayed on the menu window (can contain any character or emoji)
Every [Action ID] is case INsensitive except R and r (see below) and defines what MD action to run:
1 to n→referring to a short internal MD code in this macro (to avoid storing and calling very short and simple macros)
L→Launch external application
M→display a subMenu
R→Run macro even if disabled
r→Run macro only if enabled
T→Toggle a macro
W→Web site (open)
Other Actions could be easily added on demand...
[String] is mandatory with alphabetical Action IDs and forbidden with numerical ones.
MENU 2-level dictionary structure:
For better readability, I personally chose to precede the text of each menu item (Value field, see above) with one or more emojis to visually symbolize as follows the function described by the text:
- submenu items look like this: "→" followed by an emoji symbolizing the general content of the submenu and then its name, e.g. "→ System..." (to open System submenu)
- other functions (non-submenu) look like this: " MacroDroid homepage" (to open MacroDroid homepage) or " Firefox private window"...
As I use the macro Menu every day, it runs flawlessly on my side.
The other one, MenuUpdt, is much more tricky and may have some issues I haven't found yet... Don't hesitate to report such issues. Thanks in advance.
Macro Menu to load and run first (to initiate MENU global dictionary with some given items). It is called "Menu_" in the Template Store due to 5-char min for macro names and has to be renamed to "Menu" (without "_") on your device:
Macro MenuUpdt:
Screenshot of the current main menu below:
The MENU is based on a simple unique 2-level dictionary (global variable) where the 1st level contains the name of every submenu and the 2nd level contains every line of each submenu (the main menu name -1st entry- is 0 and it must not be changed).
Structure and syntax of 2nd level elements:
• Key=[Sort number][Action ID]>[String] where
- [Sort number] is a 2-digit number to allow menu items ordering
- [Action ID] 1 character or a number (see below)
- ">" separator character (mandatory)
- [String] is the text to be executed according to alphabetical Action IDs (package, submenu or macro name, URL...)
• Value (string type)=text displayed on the menu window (can contain any character or emoji)
Every [Action ID] is case INsensitive except R and r (see below) and defines what MD action to run:
1 to n→referring to a short internal MD code in this macro (to avoid storing and calling very short and simple macros)
L→Launch external application
M→display a subMenu
R→Run macro even if disabled
r→Run macro only if enabled
T→Toggle a macro
W→Web site (open)
Other Actions could be easily added on demand...
[String] is mandatory with alphabetical Action IDs and forbidden with numerical ones.
MENU 2-level dictionary structure:
Code:
+--0
| +--0→Exit
| +--Key #1→Value #1
| :
| +--Key #n→Value #n
|
+--Submenu #1
| +--0→Back to main Menu
| +--Key #1→Value #1
| :
| +--Key #n→Value #n
:
+--Submenu #n
+--0→Back to main Menu
+--Key #1→Value #1
:
+--Key #n→Value #n
where:
Key=[Sort number][Action ID]>[String]
For better readability, I personally chose to precede the text of each menu item (Value field, see above) with one or more emojis to visually symbolize as follows the function described by the text:
- submenu items look like this: "→" followed by an emoji symbolizing the general content of the submenu and then its name, e.g. "→ System..." (to open System submenu)
- other functions (non-submenu) look like this: " MacroDroid homepage" (to open MacroDroid homepage) or " Firefox private window"...
As I use the macro Menu every day, it runs flawlessly on my side.
The other one, MenuUpdt, is much more tricky and may have some issues I haven't found yet... Don't hesitate to report such issues. Thanks in advance.
Macro Menu to load and run first (to initiate MENU global dictionary with some given items). It is called "Menu_" in the Template Store due to 5-char min for macro names and has to be renamed to "Menu" (without "_") on your device:
Macro MenuUpdt:
Screenshot of the current main menu below: