Difference between revisions of "Actions"
Tags: Mobile web edit Mobile edit |
|||
(46 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
− | An action is something your device can do when a macro runs. A macro must have at least one action to be valid. | + | <pre style="background-color: #FFFF99; color: #112A46; border-radius: 10px; padding: 10px;"> |
+ | An action is something your device can do when a macro runs. | ||
+ | A macro must have at least one action to be valid. | ||
+ | </pre> | ||
+ | |||
+ | === Synchronous vs asynchronous === | ||
+ | <pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;"> | ||
+ | MacroDroid actions typically execute quickly, but certain actions like HTTP requests or shell scripts may take longer. To ensure that subsequent actions wait for these longer actions to complete before continuing, enable the 'Block next action until complete' option in the action's configuration GUI. Otherwise, the action will run asynchronously while other actions continue. | ||
+ | |||
+ | In traditional programming languages, you could pass a callback function to execute after the asynchronous action is complete. This allows you to perform additional actions or work with the data returned by the asynchronous action. However, MacroDroid's inner workings are arbitrary, so there is no systematic option for this. Instead, you must rely on different workarounds. | ||
+ | </pre> | ||
+ | |||
+ | == Control flow == | ||
+ | |||
+ | [[Control flow: If clause|If clause]] | ||
+ | |||
+ | [[Control flow: If confirmed then|If confirmed then]] | ||
+ | |||
+ | [[Control flow: Repeat actions|Repeat actions]] | ||
+ | |||
+ | [[Control flow: Iterate Dictionary/Array| Iterate Dictionary/Array]] | ||
+ | |||
+ | [[Control flow: Break from loop|Break from loop]] | ||
+ | |||
+ | [[Control flow: Continue loop|Continue loop]] | ||
== List of Actions == | == List of Actions == | ||
+ | |||
+ | [[Action: Accessibility Service|Accessibility Service]] | ||
+ | |||
+ | [[Action: Action Block|Action Block]] | ||
[[Action: Airplane Mode On/Off|Airplane Mode On/Off]] | [[Action: Airplane Mode On/Off|Airplane Mode On/Off]] | ||
Line 8: | Line 36: | ||
[[Action: Ambient Display|Ambient Display]] | [[Action: Ambient Display|Ambient Display]] | ||
+ | |||
+ | [[Action: Animation Overlay|Animation Overlay]] | ||
[[Action: Android Shortcut|Android Shortcut]] | [[Action: Android Shortcut|Android Shortcut]] | ||
Line 14: | Line 44: | ||
[[Action: Answer Call|Answer Call]] | [[Action: Answer Call|Answer Call]] | ||
+ | |||
+ | [[Action: App Enable/Disable|App Enable/Disable]] | ||
+ | |||
+ | [[Action: Authenticate User|Authenticate User]] | ||
+ | |||
+ | [[Action: Array Manipulation|Array Manipulation]] | ||
[[Action: Autosync On/Off|Autosync On/Off]] | [[Action: Autosync On/Off|Autosync On/Off]] | ||
[[Action: Battery Saver|Battery Saver]] | [[Action: Battery Saver|Battery Saver]] | ||
+ | |||
+ | [[Action: Block Screen Touch|Screen Block Touch]] | ||
[[Action: Bluetooth Configure|Bluetooth Configure]] | [[Action: Bluetooth Configure|Bluetooth Configure]] | ||
− | |||
− | |||
[[Action: Brightness|Brightness]] | [[Action: Brightness|Brightness]] | ||
Line 34: | Line 70: | ||
[[Action: Car Mode|Car Mode]] | [[Action: Car Mode|Car Mode]] | ||
+ | |||
+ | [[Action: Check Pixel Colour|Check pixel colour]] | ||
+ | |||
+ | [[Action: Check Text In Screenshot|Check Text In Screenshot]] | ||
+ | |||
+ | [[Action: Check Text On Screen|Check Text On Screen]] | ||
[[Action: Clear App Data|Clear App Data]] | [[Action: Clear App Data|Clear App Data]] | ||
[[Action: Clear Call Log|Clear Call Log]] | [[Action: Clear Call Log|Clear Call Log]] | ||
+ | |||
+ | [[Action: Clear Dictionary/Array Entry|Clear Dictionary/Array Entry]] | ||
+ | |||
+ | [[Action: Clear MacroDroid Dialog|Clear MacroDroid Dialog]] | ||
[[Action: Clear Log|Clear Log]] | [[Action: Clear Log|Clear Log]] | ||
[[Action: Clear Notifications|Clear Notifications]] | [[Action: Clear Notifications|Clear Notifications]] | ||
+ | |||
+ | [[Action: Clear Variables|Clear Variables]] | ||
+ | |||
+ | [[Action: Clipboard Refresh|Clipboard Refresh]] | ||
[[Action: Configure App Notifications|Configure App Notifications]] | [[Action: Configure App Notifications|Configure App Notifications]] | ||
+ | |||
+ | [[Action: Configure Quick Tile|Configure Quick Tile]] | ||
[[Action: Confirm Next|Confirm Next]] | [[Action: Confirm Next|Confirm Next]] | ||
Line 53: | Line 105: | ||
[[Action: Control Media|Control Media]] | [[Action: Control Media|Control Media]] | ||
− | [[Action: Dark Theme]] | + | [[Action: Dark Theme|Dark Theme]] |
+ | |||
+ | [[Action: Daydream/Screensaver On|Daydream/Screensaver On]] | ||
+ | |||
+ | [[Action: Delete Macro|Delete Macro]] | ||
+ | |||
+ | [[Action: Delete Variable|Delete Variable]] | ||
+ | |||
+ | [[Action: Demo Mode|Demo Mode]] | ||
+ | |||
+ | [[Action: Dim Screen|Dim Screen]] | ||
+ | |||
+ | [[Action: Disable MacroDroid|Disable MacroDroid]] | ||
+ | |||
+ | [[Action: Display Bubble Notification|Display Bubble Notification]] | ||
+ | |||
+ | [[Action: Display Dialog|Display Dialog]] | ||
+ | |||
+ | [[Action: Display Notification|Display Notification]] | ||
+ | |||
+ | [[Action: Empty Action|Empty Action]] | ||
+ | |||
+ | [[Action: Enable/Disable Category|Enable/Disable Category]] | ||
+ | |||
+ | [[Action: Enable/Disable Macro|Enable/Disable Macro]] | ||
+ | |||
+ | [[Action: Enable/Disable Trigger|Enable/Disable Trigger]] | ||
+ | |||
+ | [[Action: Exit Action Block|Exit Action Block]] | ||
+ | |||
+ | [[Action: Expand/Collapse Status Bar|Expand/Collapse Status Bar]] | ||
+ | |||
+ | [[Action: Export Log|Export Log]] | ||
+ | |||
+ | [[Action: Export Macros|Export Macros]] | ||
+ | |||
+ | [[Action: File Operation| File Operation]] | ||
+ | |||
+ | [[Action: Fill Clipboard|Fill Clipboard]] | ||
+ | |||
+ | [[Action: Floating Button Configure|Floating Button Configure]] | ||
+ | |||
+ | [[Action: Floating text|Floating text]] | ||
+ | |||
+ | [[Action: Font Scale|Font Scale]] | ||
+ | |||
+ | [[Action: Force Location Update|Force Location Update]] | ||
+ | |||
+ | [[Action: Force Screen Rotation|Force Screen Rotation]] | ||
+ | |||
+ | [[Action: Get Light Level|Get Light Level]] | ||
− | [[Action: | + | [[Action: Get Text From View Id|Get Text From View Id]] |
− | [[Action: | + | [[Action: GPS Enable/Disable|GPS Enable/Disable]] |
− | [[Action: | + | [[Action: Heads-up Enable/Disable|Heads-up Enable/Disable]] |
− | [[Action: | + | [[Action: HotSpot On/Off|HotSpot On/Off]] |
− | [[Action: | + | [[Action: HTTP Request|HTTP Request]] |
− | [[Action: | + | [[Action: HTTP Server|HTTP Server]] |
− | [[Action: | + | [[Action: Immersive Mode|Immersive Mode]] |
− | [[Action: | + | [[Action: JavaScript Code|JavaScript Code]] |
− | [[Action: | + | [[Action: Invert Colours|Invert Colours]] |
− | [[Action: | + | [[Action: JSON Parse|JSON Parse]] |
− | [[Action: | + | [[Action: Keep Device Awake|Keep Device Awake]] |
− | [[Action: | + | [[Action: Keyboard - Set Default|Keyboard - Set Default]] |
− | [[Action: | + | [[Action: Keyboard Prompt|Keyboard Prompt]] |
− | [[Action: | + | [[Action: Kill Application|Kill Application]] |
− | [[Action: | + | [[Action: Kill Background Processes|Kill Background Processes]] |
− | [[Action: | + | [[Action: Launch and Press|Launch and Press]] |
− | [[Action: | + | [[Action: Launch Application|Launch Application]] |
− | [[Action: | + | [[Action: Launch Home Screen|Launch Home Screen]] |
− | [[Action: | + | [[Action: Launch Shortcut|Launch Shortcut]] |
− | [[Action: | + | [[Action: Locale/Tasker Plugin|Locale/Tasker Plugin]] |
− | [[Action: | + | [[Action: Location Mode|Location Mode]] |
− | [[Action: | + | [[Action: Log Event|Log Event]] |
− | [[Action: | + | [[Action: MacroDroid Drawer|MacroDroid Drawer]] |
− | [[Action: | + | [[Action: MacroDroid Settings|MacroDroid Settings]] |
− | [[Action: | + | [[Action: Macro run|Macro run]] |
− | [[Action: | + | [[Action: Make Call|Make Call]] |
− | [[Action: | + | [[Action: Mobile Data On/Off|Mobile Data On/Off]] |
− | [[Action: | + | [[Action: NFC Enable/Disable|NFC Enable/Disable]] |
− | [[Action: | + | [[Action: Notification Interaction|Notification Interaction]] |
− | [[Action: | + | [[Action: Notification LED Enable/Disable|Notification LED Enable/Disable]] |
− | [[Action: | + | [[Action: Notification Reply|Notification Reply]] |
− | [[Action: | + | [[Action: Open Call Log|Open Call Log]] |
− | [[Action: | + | [[Action: Open File|Open File]] |
− | [[Action: | + | [[Action: Open Last Photo|Open Last Photo]] |
− | [[Action: MacroDroid | + | [[Action: Open MacroDroid Log|Open MacroDroid Log]] |
− | [[Action: | + | [[Action: Open Website / HTTP GET|Open Website / HTTP GET]] |
− | [[Action: | + | [[Action: Option Dialog|Option Dialog]] |
− | [[Action: | + | [[Action: Play/Stop Sound|Play/Stop Sound]] |
− | [[Action: | + | [[Action: Popup Message|Popup Message]] |
− | [[Action: | + | [[Action: Press Back Button|Press Back Button]] |
− | [[Action: | + | [[Action: Priority Mode / Do Not Disturb|Priority Mode / Do Not Disturb]] |
− | [[Action: | + | [[Action: Read Screen Contents|Read Screen Contents]] |
− | [[Action: | + | [[Action: Read Screenshot Contents|Read Screenshot Contents]] |
− | [[Action: | + | [[Action: Reboot/Power Off|Reboot/Power Off]] |
− | [[Action: | + | [[Action: Record Microphone|Record Microphone]] |
− | [[Action: | + | [[Action: Restore Hidden Notifications|Restore Hidden Notifications]] |
− | [[Action: | + | [[Action: Ringtone Configure|Ringtone Configure]] |
− | [[Action: | + | [[Action: Say Current Time|Say Current Time]] |
− | [[Action: | + | [[Action: Screen On/Off|Screen On/Off]] |
− | [[Action: | + | [[Action: Secure Settings|Secure Settings]] |
− | [[Action: | + | [[Action: Selecttion Dialog|Selection Dialog]] |
− | [[Action: | + | [[Action: Send Email|Send Email]] |
− | [[Action: | + | [[Action: Send Intent|Send Intent]] |
− | [[Action: | + | [[Action: Send SMS|Send SMS]] |
− | [[Action: | + | [[Action: Set Button Bar Image|Set Button Bar Image]] |
− | [[Action: | + | [[Action: Set Location Update Rate|Set Location Update Rate]] |
− | [[Action: | + | [[Action: Set Digital Assistant|Set Digital Assistant]] |
− | [[Action: | + | [[Action: Set MacroDroid Icon|Set MacroDroid Icon]] |
− | [[Action: | + | [[Action: Set MacroDroid Mode|Set MacroDroid Mode]] |
− | [[Action: | + | [[Action: Set MacroDroid Notification Text|Set MacroDroid Notification Text]] |
− | [[Action: Set | + | [[Action: Set Notification Sound|Set Notification Sound]] |
− | [[Action: Set | + | [[Action: Set Screen Lock|Set Screen Lock]] |
− | [[Action: Set | + | [[Action: Set Screen Timeout|Set Screen Timeout]] |
− | [[Action: Set | + | [[Action: Set Variable|Set Variable]] |
− | [[Action: Set | + | [[Action: Set Wallpaper|Set Wallpaper]] |
− | [[Action: | + | [[Action: Share Last Photo|Share Last Photo]] |
− | [[Action: | + | [[Action: Share Text|Share Text]] |
− | [[Action: | + | [[Action: Share Location|Share Location]] |
− | [[Action: | + | [[Action: Shell Script|Shell Script]] |
− | [[Action: | + | [[Action: Silent - Vibrate Off|Silent - Vibrate Off]] |
− | [[Action: | + | [[Action: Silent - Show Volume Popup|Show Volume Popup]] |
− | [[Action: | + | [[Action: Speak Text|Speak Text]] |
− | [[Action: | + | [[Action: Speakerphone On/Off|Speakerphone On/Off]] |
− | [[Action: | + | [[Action: Stopwatch|Stopwatch]] |
− | [[Action: | + | [[Action: Sync Account|Sync Account]] |
− | [[Action: | + | [[Action: System Setting|System Setting]] |
− | [[Action: | + | [[Action: Take Picture|Take Picture]] |
− | [[Action: | + | [[Action: Take Screenshot|Take Screenshot]] |
− | [[Action: | + | [[Action: Text_from_Image_(OCR)|Text from Image (OCR)]] |
− | [[Action: | + | [[Action: Text Manipulation|Text Manipulation]] |
− | [[Action: | + | [[Action: Torch On/Off|Torch On/Off]] |
− | [[Action: Text | + | [[Action: Translate Text|Translate Text]] |
− | [[Action: | + | [[Action: Touch Screen|Touch Screen]] |
− | [[Action: | + | [[Action: UDP Command|UDP Command]] |
− | [[Action: | + | [[Action: UI Interaction|UI Interaction]] |
− | [[Action: | + | [[Action: USB Tethering|USB Tethering]] |
− | [[Action: | + | [[Action: Vibrate|Vibrate]] |
− | [[Action: | + | [[Action: Vibrate Enable/Disable|Vibrate Enable/Disable]] |
− | [[Action: | + | [[Action: Voice Input|Voice Input]] |
− | [[Action: | + | [[Action: Voice Search|Voice Search]] |
− | [[Action: | + | [[Action: Volume Change|Volume Change]] |
− | [[Action: Volume | + | [[Action: Volume Up/Down|Volume Up/Down]] |
− | [[Action: | + | [[Action: Wait Before Next Action|Wait Before Next Action]] |
− | [[Action: Wait | + | [[Action: Wait Until Trigger|Wait Until Trigger]] |
− | [[Action: | + | [[Action: WhatsApp Send|WhatsApp Send]] |
− | [[Action: Widget Button Modify]] | + | [[Action: Widget Button Modify|Widget Button Modify]] |
− | [[Action: Wifi Configure]] | + | [[Action: Wifi Configure|Wifi Configure]] |
− | [[Action: Write to File]] | + | [[Action: Write to File|Write to File]] |
Latest revision as of 12:26, 15 August 2024
An action is something your device can do when a macro runs. A macro must have at least one action to be valid.
Synchronous vs asynchronous
MacroDroid actions typically execute quickly, but certain actions like HTTP requests or shell scripts may take longer. To ensure that subsequent actions wait for these longer actions to complete before continuing, enable the 'Block next action until complete' option in the action's configuration GUI. Otherwise, the action will run asynchronously while other actions continue. In traditional programming languages, you could pass a callback function to execute after the asynchronous action is complete. This allows you to perform additional actions or work with the data returned by the asynchronous action. However, MacroDroid's inner workings are arbitrary, so there is no systematic option for this. Instead, you must rely on different workarounds.
Control flow
List of Actions
Notification LED Enable/Disable
Priority Mode / Do Not Disturb