(42 intermediate revisions by 6 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 ==
  
[[Airplane Mode On/Off]]
+
[[Action: Accessibility Service|Accessibility Service]]
 +
 
 +
[[Action: Action Block|Action Block]]
 +
 
 +
[[Action: Airplane Mode On/Off|Airplane Mode On/Off]]
 +
 
 +
[[Action: Alarm Clock|Alarm Clock]]
 +
 
 +
[[Action: Ambient Display|Ambient Display]]
 +
 
 +
[[Action: Animation Overlay|Animation Overlay]]
 +
 
 +
[[Action: Android Shortcut|Android Shortcut]]
 +
 
 +
[[Action: Android Wear|Android Wear]]
 +
 
 +
[[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: Battery Saver|Battery Saver]]
 +
 
 +
[[Action: Block Screen Touch|Screen Block Touch]]
 +
 
 +
[[Action: Bluetooth Configure|Bluetooth Configure]]
 +
 
 +
[[Action: Brightness|Brightness]]
 +
 
 +
[[Action: Calendar - Add Event|Calendar - Add Event]]
 +
 
 +
[[Action: Call Reject|Call Reject]]
 +
 
 +
[[Action: Camera Enable/Disable|Camera Enable/Disable]]
 +
 
 +
[[Action: Cancel Macro Actions|Cancel Macro Actions]]
 +
 
 +
[[Action: Car Mode|Car Mode]]
 +
 
 +
[[Action: Check Colour Pixel|Check Colour Pixel]]
 +
 
 +
[[Action: Check Text In Screenshot|Check Text In Screenshot]]
 +
 
 +
[[Action: Check Text On Screen|Check Text To Screen]]
 +
 
 +
[[Action: Clear App Data|Clear App Data]]
 +
 
 +
[[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 Notifications|Clear Notifications]]
 +
 
 +
[[Action: Clear Variables|Clear Variables]]
 +
 
 +
[[Action: Clipboard Refresh|Clipboard Refresh]]
 +
 
 +
[[Action: Configure App Notifications|Configure App Notifications]]
 +
 
 +
[[Action: Configure Quick Tile|Configure Quick Tile]]
 +
 
 +
[[Action: Confirm Next|Confirm Next]]
 +
 
 +
[[Action: Connectivity Check|Connectivity Check]]
 +
 
 +
[[Action: Contact Via App|Contact Via App]]
 +
 
 +
[[Action: Control Media|Control Media]]
  
[[Alarm Clock]]
+
[[Action: Dark Theme|Dark Theme]]
  
[[Ambient Display]]
+
[[Action: Daydream/Screensaver On|Daydream/Screensaver On]]
  
[[Android Shortcut]]
+
[[Action: Delete Macro|Delete Macro]]
  
[[Android Wear]]
+
[[Action: Delete Variable|Delete Variable]]
  
[[Answer Call]]
+
[[Action: Demo Mode|Demo Mode]]
  
[[Autosync On/Off]]
+
[[Action: Dim Screen|Dim Screen]]
  
[[Battery Saver]]
+
[[Action: Disable MacroDroid|Disable MacroDroid]]
  
[[Bluetooth Configure]]
+
[[Action: Display Bubble Notification|Display Bubble Notification]]
  
[[Bluetooth Tethering]]
+
[[Action: Display Dialog|Display Dialog]]
  
[[Brightness]]
+
[[Action: Display Notification|Display Notification]]
  
[[Calendar - Add Event]]
+
[[Action: Empty Action|Empty Action]]
  
[[Call Reject]]
+
[[Action: Enable/Disable Category|Enable/Disable Category]]
  
[[Camera Enable/Disable]]
+
[[Action: Enable/Disable Macro|Enable/Disable Macro]]
  
[[Cancel Macro Actions]]
+
[[Action: Enable/Disable Trigger|Enable/Disable Trigger]]
  
[[Car Mode]]
+
[[Action: Exit Action Block|Exit Action Block]]
  
[[Clear App Data]]
+
[[Action: Expand/Collapse Status Bar|Expand/Collapse Status Bar]]
  
[[Clear Call Log]]
+
[[Action: Export Log|Export Log]]
  
[[Clear Log]]
+
[[Action: Export Macros|Export Macros]]
  
[[Clear Notifications]]
+
[[Action: File Operation| File Operation]]
  
[[Configure App Notifications]]
+
[[Action: Fill Clipboard|Fill Clipboard]]
  
[[Confirm Next]]
+
[[Action: Floating Button Configure|Floating Button Configure]]
  
[[Connectivity Check]]
+
[[Action: Floating text|Floating text]]
  
[[Contact Via App]]
+
[[Action: Font Scale|Font Scale]]
  
[[Control Media]]
+
[[Action: Force Location Update|Force Location Update]]
  
[[Dark Theme]]
+
[[Action: Force Screen Rotation|Force Screen Rotation]]
  
[[Daydream/Screensaver On]]
+
[[Action: Get Light Level|Get Light Level]]
  
[[Delete Macro]]
+
[[Action: Get Text From View ID|Get Text From View ID]]
  
[[Demo Mode]]
+
[[Action: GPS Enable/Disable|GPS Enable/Disable]]
  
[[Dim Screen]]
+
[[Action: Heads-up Enable/Disable|Heads-up Enable/Disable]]
  
[[Disable MacroDroid]]
+
[[Action: HotSpot On/Off|HotSpot On/Off]]
  
[[Display Dialog]]
+
[[Action: HTTP Request|HTTP Request]]
  
[[Display Notification]]
+
[[Action: HTTP Server|HTTP Server]]
  
[[Empty Action]]
+
[[Action: Immersive Mode|Immersive Mode]]
  
[[Enable/Disable Category]]
+
[[Action: JavaScript Code|JavaScript Code]]
  
[[Enable/Disable Macro]]
+
[[Action: Invert Colours|Invert Colours]]
  
[[Expand/Collapse Status Bar]]
+
[[Action: JSON Parse|JSON Parse]]
  
[[Export Macros]]
+
[[Action: Keep Device Awake|Keep Device Awake]]
  
[[File Operations V2]]
+
[[Action: Keyboard - Set Default|Keyboard - Set Default]]
  
[[Fill Clipboard]]
+
[[Action: Keyboard Prompt|Keyboard Prompt]]
  
[[Font Scale]]
+
[[Action: Kill Application|Kill Application]]
  
[[Force Location Update]]
+
[[Action: Kill Background Processes|Kill Background Processes]]
  
[[Force Screen Rotation]]
+
[[Action: Launch and Press|Launch and Press]]
  
[[GPS Enable/Disable]]
+
[[Action: Launch Application|Launch Application]]
  
[[Heads-up Enable/Disable]]
+
[[Action: Launch Home Screen|Launch Home Screen]]
  
[[HotSpot On/Off]]
+
[[Action: Launch Shortcut|Launch Shortcut]]
  
[[Immersive Mode]]
+
[[Action: Locale/Tasker Plugin|Locale/Tasker Plugin]]
  
[[Invert Colours]]
+
[[Action: Location Mode|Location Mode]]
  
[[Keep Device Awake]]
+
[[Action: Log Event|Log Event]]
  
[[Keyboard - Set Default]]
+
[[Action: MacroDroid Drawer|MacroDroid Drawer]]
  
[[Keyboard Prompt]]
+
[[Action: MacroDroid Settings|MacroDroid Settings]]
  
[[Kill Application]]
+
[[Action: Macro run|Macro run]]
  
[[Kill Background Processes]]
+
[[Action: Make Call|Make Call]]
  
[[Launch and Press]]
+
[[Action: Mobile Data On/Off|Mobile Data On/Off]]
  
[[Launch Application]]
+
[[Action: NFC Enable/Disable|NFC Enable/Disable]]
  
[[Launch Home Screen]]
+
[[Action: Notification Interaction|Notification Interaction]]
  
[[Launch Shortcut]]
+
[[Action: Notification LED Enable/Disable|Notification LED Enable/Disable]]
  
[[Locale/Tasker Plugin]]
+
[[Action: Notification Reply|Notification Reply]]
  
[[Location Mode]]
+
[[Action: Open Call Log|Open Call Log]]
  
[[Log Event]]
+
[[Action: Open File|Open File]]
  
[[MacroDroid Drawer]]
+
[[Action: Open Last Photo|Open Last Photo]]
  
[[MacroDroid Settings]]
+
[[Action: Open MacroDroid Log|Open MacroDroid Log]]
  
[[Make Call]]
+
[[Action: Open Website / HTTP GET|Open Website / HTTP GET]]
  
[[Mobile Data On/Off]]
+
[[Action: Option Dialog|Option Dialog]]
  
[[NFC Enable/Disable]]
+
[[Action: Play/Stop Sound|Play/Stop Sound]]
  
[[Notification Interaction]]
+
[[Action: Popup Message|Popup Message]]
  
[[Notification LED Enable/Disable]]
+
[[Action: Press Back Button|Press Back Button]]
  
[[Open Call Log]]
+
[[Action: Priority Mode / Do Not Disturb|Priority Mode / Do Not Disturb]]
  
[[Open File]]
+
[[Action: Read Screen Contents|Read Screen Contents]]
  
[[Open Last Photo]]
+
[[Action: Read Screenshot Contents|Read Screenshot Contents]]
  
[[Open MacroDroid Log]]
+
[[Action: Reboot/Power Off|Reboot/Power Off]]
  
[[Open Website / HTTP GET]]
+
[[Action: Record Microphone|Record Microphone]]
  
[[Option Dialog]]
+
[[Action: Restore Hidden Notifications|Restore Hidden Notifications]]
  
[[Play/Stop Sound]]
+
[[Action: Ringtone Configure|Ringtone Configure]]
  
[[Popup Message]]
+
[[Action: Say Current Time|Say Current Time]]
  
[[Press Back Button]]
+
[[Action: Screen On/Off|Screen On/Off]]
  
[[Priority Mode / Do Not Disturb]]
+
[[Action: Secure Settings|Secure Settings]]
  
[[Reboot/Power Off]]
+
[[Action: Selecttion Dialog|Selection Dialog]]
  
[[Record Microphone]]
+
[[Action: Send Email|Send Email]]
  
[[Ringtone Configure]]
+
[[Action: Send Intent|Send Intent]]
  
[[Say Current Time]]
+
[[Action: Send SMS|Send SMS]]
  
[[Screen On/Off]]
+
[[Action: Set Button Bar Image|Set Button Bar Image]]
  
[[Secure Settings]]
+
[[Action: Set Location Update Rate|Set Location Update Rate]]
  
[[Send Email]]
+
[[Action: Set Digital Assistant|Set Digital Assistant]]
  
[[Send Intent]]
+
[[Action: Set MacroDroid Icon|Set MacroDroid Icon]]
  
[[Send SMS]]
+
[[Action: Set MacroDroid Mode|Set MacroDroid Mode]]
  
[[Set Location Update Rate]]
+
[[Action: Set MacroDroid Notification Text|Set MacroDroid Notification Text]]
  
[[Set MacroDroid Icon]]
+
[[Action: Set Notification Sound|Set Notification Sound]]
  
[[Set MacroDroid Mode]]
+
[[Action: Set Screen Lock|Set Screen Lock]]
  
[[Set MacroDroid Notification Text]]
+
[[Action: Set Screen Timeout|Set Screen Timeout]]
  
[[Set Notification Sound]]
+
[[Action: Set Variable|Set Variable]]
  
[[Set Quick Settings Tile State]]
+
[[Action: Set Wallpaper|Set Wallpaper]]
  
[[Set Screen Lock]]
+
[[Action: Share Last Photo|Share Last Photo]]
  
[[Set Screen Timeout]]
+
[[Action: Share Text|Share Text]]
  
[[Set Variable]]
+
[[Action: Share Location|Share Location]]
  
[[Set Wallpaper]]
+
[[Action: Shell Script|Shell Script]]
  
[[Share Last Photo]]
+
[[Action: Silent - Vibrate Off|Silent - Vibrate Off]]
  
[[Share Location]]
+
[[Action: Silent - Show Volume Popup|Show Volume Popup]]
  
[[Shell Script]]
+
[[Action: Speak Text|Speak Text]]
  
[[Silent - Vibrate Off]]
+
[[Action: Speakerphone On/Off|Speakerphone On/Off]]
  
[[Speak Text]]
+
[[Action: Stopwatch|Stopwatch]]
  
[[Speakerphone On/Off]]
+
[[Action: Sync Account|Sync Account]]
  
[[Stopwatch]]
+
[[Action: System Setting|System Setting]]
  
[[Sync Account]]
+
[[Action: Take Picture|Take Picture]]
  
[[System Setting]]
+
[[Action: Take Screenshot|Take Screenshot]]
  
[[Take Picture]]
+
[[Action: Text Manipulation|Text Manipulation]]
  
[[Take Screenshot]]
+
[[Action: Torch On/Off|Torch On/Off]]
  
[[Text Manipulation]]
+
[[Action: Translate Text|Translate Text]]
  
[[Torch On/Off]]
+
[[Action: Touch Screen|Touch Screen]]
  
[[Touch Screen]]
+
[[Action: UDP Command|UDP Command]]
  
[[Tweet]]
+
[[Action: UI Interaction|UI Interaction]]
  
[[UDB Command]]
+
[[Action: USB Tethering|USB Tethering]]
  
[[UI Interaction]]
+
[[Action: Vibrate|Vibrate]]
  
[[USB Tethering]]
+
[[Action: Vibrate Enable/Disable|Vibrate Enable/Disable]]
  
[[Vibrate]]
+
[[Action: Voice Input|Voice Input]]
  
[[Vibrate Enable/Disable]]
+
[[Action: Voice Search|Voice Search]]
  
[[Voice Search]]
+
[[Action: Volume Change|Volume Change]]
  
[[Volume Change]]
+
[[Action: Volume Up/Down|Volume Up/Down]]
  
[[Volume Up/Down]]
+
[[Action: Wait Before Next Action|Wait Before Next Action]]
  
[[Wait Before Next Action]]
+
[[Action: Wait Until Trigger|Wait Until Trigger]]
  
[[Wait Until Trigger]]
+
[[Action: WhatsApp Send|WhatsApp Send]]
  
[[Widget Button Modify]]
+
[[Action: Widget Button Modify|Widget Button Modify]]
  
[[Wifi Configure]]
+
[[Action: Wifi Configure|Wifi Configure]]
  
[[Write to File]]
+
[[Action: Write to File|Write to File]]

Latest revision as of 17:36, 15 April 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

If clause

If confirmed then

Repeat actions

Iterate Dictionary/Array

Break from loop

Continue loop

List of Actions

Accessibility Service

Action Block

Airplane Mode On/Off

Alarm Clock

Ambient Display

Animation Overlay

Android Shortcut

Android Wear

Answer Call

App Enable/Disable

Authenticate User

Array Manipulation

Autosync On/Off

Battery Saver

Screen Block Touch

Bluetooth Configure

Brightness

Calendar - Add Event

Call Reject

Camera Enable/Disable

Cancel Macro Actions

Car Mode

Check Colour Pixel

Check Text In Screenshot

Check Text To Screen

Clear App Data

Clear Call Log

Clear Dictionary/Array Entry

Clear MacroDroid Dialog

Clear Log

Clear Notifications

Clear Variables

Clipboard Refresh

Configure App Notifications

Configure Quick Tile

Confirm Next

Connectivity Check

Contact Via App

Control Media

Dark Theme

Daydream/Screensaver On

Delete Macro

Delete Variable

Demo Mode

Dim Screen

Disable MacroDroid

Display Bubble Notification

Display Dialog

Display Notification

Empty Action

Enable/Disable Category

Enable/Disable Macro

Enable/Disable Trigger

Exit Action Block

Expand/Collapse Status Bar

Export Log

Export Macros

File Operation

Fill Clipboard

Floating Button Configure

Floating text

Font Scale

Force Location Update

Force Screen Rotation

Get Light Level

Get Text From View ID

GPS Enable/Disable

Heads-up Enable/Disable

HotSpot On/Off

HTTP Request

HTTP Server

Immersive Mode

JavaScript Code

Invert Colours

JSON Parse

Keep Device Awake

Keyboard - Set Default

Keyboard Prompt

Kill Application

Kill Background Processes

Launch and Press

Launch Application

Launch Home Screen

Launch Shortcut

Locale/Tasker Plugin

Location Mode

Log Event

MacroDroid Drawer

MacroDroid Settings

Macro run

Make Call

Mobile Data On/Off

NFC Enable/Disable

Notification Interaction

Notification LED Enable/Disable

Notification Reply

Open Call Log

Open File

Open Last Photo

Open MacroDroid Log

Open Website / HTTP GET

Option Dialog

Play/Stop Sound

Popup Message

Press Back Button

Priority Mode / Do Not Disturb

Read Screen Contents

Read Screenshot Contents

Reboot/Power Off

Record Microphone

Restore Hidden Notifications

Ringtone Configure

Say Current Time

Screen On/Off

Secure Settings

Selection Dialog

Send Email

Send Intent

Send SMS

Set Button Bar Image

Set Location Update Rate

Set Digital Assistant

Set MacroDroid Icon

Set MacroDroid Mode

Set MacroDroid Notification Text

Set Notification Sound

Set Screen Lock

Set Screen Timeout

Set Variable

Set Wallpaper

Share Last Photo

Share Text

Share Location

Shell Script

Silent - Vibrate Off

Show Volume Popup

Speak Text

Speakerphone On/Off

Stopwatch

Sync Account

System Setting

Take Picture

Take Screenshot

Text Manipulation

Torch On/Off

Translate Text

Touch Screen

UDP Command

UI Interaction

USB Tethering

Vibrate

Vibrate Enable/Disable

Voice Input

Voice Search

Volume Change

Volume Up/Down

Wait Before Next Action

Wait Until Trigger

WhatsApp Send

Widget Button Modify

Wifi Configure

Write to File