m
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
<div style="border-radius: 10px; background-color: #f4f4f4; padding: 20px; box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);">
 +
 +
== Magic Text Overview ==
 +
 +
Many triggers, actions, and constraints allow you to configure some text fields. Often, you will find a button next to the text input field that contains the "..." label. This button displays a complete list of "magic text" fields available in the context you are using.
 +
 +
If you want to type them manually instead, if you know them, be aware that there may be spelling/typing errors.
 +
 +
=== How Magic Text Works ===
 +
 +
The magic text allows a different value to be substituted at the point of call, instead of the standard static text that never changes. For example, it's possible to add an action that references a variable via magic text, and that variable's value will be substituted at the point the action is executed.
 +
 +
=== Magic Text Formats ===
 +
 +
Magic text can be written in two ways:
 +
* Curly braces: {value}
 +
* Square braces: [value]
 +
 +
Curly brackets are not supported on very old versions like v5.20 and below, but it's recommended to use them when interacting with dictionaries/arrays, as square brackets can get confusing very quickly.
  
</pre>
 
 
<div style="border-radius: 10px; background-color: #f4f4f4; padding: 20px; box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);">
 
<div style="border-radius: 10px; background-color: #f4f4f4; padding: 20px; box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);">
  
Line 75: Line 93:
 
|-
 
|-
 
! style="background-color:#1665B0; color:white; width:50%;" | Name
 
! style="background-color:#1665B0; color:white; width:50%;" | Name
! style="background-color:#1665B0; color:white; width:50%;" | Battery current now (mA)
+
! style="background-color:#1665B0; color:white; width:50%;" | Application name
 
|-
 
|-
| Magic text      || {battery_current_now}
+
| Magic text      || {app_name}
 
|-
 
|-
| Description      || Amount of electrical current flowing from the battery at this moment, measured in milliamps (mA).
+
| Description      || Gets the name of the application that was opened or closed according to the context.
 
|-
 
|-
| Does it require a trigger? || No
+
| Does it require a trigger? || Yes, it requires an Application Launched/Closed trigger to be present.
 
|}
 
|}
  
Line 87: Line 105:
 
|-
 
|-
 
! style="background-color:#1665B0; color:white; width:50%;" | Name
 
! style="background-color:#1665B0; color:white; width:50%;" | Name
! style="background-color:#1665B0; color:white; width:50%;" | Battery temp ºC
+
! style="background-color:#1665B0; color:white; width:50%;" | Application package
 
|-
 
|-
| Magic text      || {battery_temp}
+
| Magic text      || {app_package}
 
|-
 
|-
| Description      || Temperature in degrees Celsius, e.g. 34°.
+
| Description      || Gets the name of the application that was opened or closed according to the context.
|}
 
 
 
{| class="wikitable" style="width:100%; text-align:left; border:none; background-color:#f2f2f2; border-radius: 10px; border: 1px solid #ddd;"
 
 
|-
 
|-
! style="background-color:#1665B0; color:white; width:50%;" | Name
+
| Does it require a trigger? || Yes, it requires an Application Launched/Closed trigger to be present.
! style="background-color:#1665B0; color:white; width:50%;" | Cell connection type
 
|-
 
| Magic text      || {cell_connection}
 
|-
 
| Description      || Cell connection type, e.g. 3G, 4G, 5G.
 
 
|}
 
|}
  
Line 107: Line 117:
 
|-
 
|-
 
! style="background-color:#1665B0; color:white; width:50%;" | Name
 
! style="background-color:#1665B0; color:white; width:50%;" | Name
! style="background-color:#1665B0; color:white; width:50%;" | Cell id
+
! style="background-color:#1665B0; color:white; width:50%;" | Battery current now (mA)
 
|-
 
|-
| Magic text      || {cell_id}
+
| Magic text      || {battery_current_now}
 
|-
 
|-
| Description      || Number that identifies an individual cell within a cellular network. Used for mobile phones to connect to the network and for the network to send data to mobile phones
+
| Description      || Amount of electrical current flowing from the battery at this moment, measured in milliamps (mA).
e.g. The cell identifier for a cell in New York City could be 310-200-0000. The LAC (310-200)
 
|}
 
 
 
{| class="wikitable" style="width:100%; text-align:left; border:none; background-color:#f2f2f2; border-radius: 10px; border: 1px solid #ddd;"
 
|-
 
! style="background-color:#1665B0; color:white; width:50%;" | Name
 
! style="background-color:#1665B0; color:white; width:50%;" | Cell tower signal strength
 
|-
 
| Magic text      || {cell_signal_strength}
 
|-
 
| Description      || Returns the signal strength that your mobile device is receiving from the nearest cell tower. It is expressed in units called decibels-milliwatts (dBm), with -50 dBm being the strongest signal and -110 dBm being the weakest.
 
|}
 
 
 
{| class="wikitable" style="width:100%; text-align:left; border:none; background-color:#f2f2f2; border-radius: 10px; border: 1px solid #ddd;"
 
|-
 
! style="background-color:#1665B0; color:white; width:50%;" | Name
 
! style="background-color:#1665B0; color:white; width:50%;" | Clipboard text
 
|-
 
| Magic text      || {clipboard}
 
|-
 
| Description      || Retrieves the text from the clipboard.
 
If you are on Android 10+ you should have a look at the [https://macrodroidforum.com/wiki/index.php/Action:_Clipboard_Refresh Refresh Cliboard action].
 
|}
 
 
 
{| class="wikitable" style="width:100%; text-align:left; border:none; background-color:#f2f2f2; border-radius: 10px; border: 1px solid #ddd;"
 
|-
 
! style="background-color:#1665B0; color:white; width:50%;" | Name
 
! style="background-color:#1665B0; color:white; width:50%;" | Current battery %
 
|-
 
| Magic text      || {battery}
 
|-
 
| Description      || Information on the current battery charge percentage, e.g. 80%.
 
 
|-
 
|-
 
| Does it require a trigger? || No
 
| Does it require a trigger? || No
Line 151: Line 129:
 
|-
 
|-
 
! style="background-color:#1665B0; color:white; width:50%;" | Name
 
! style="background-color:#1665B0; color:white; width:50%;" | Name
! style="background-color:#1665B0; color:white; width:50%;" | Current Brightness
+
! style="background-color:#1665B0; color:white; width:50%;" | Battery temp ºC
 
|-
 
|-
| Magic text      || {current_brightness}
+
| Magic text      || {battery_temp}
 
|-
 
|-
| Description      || Information on the current brightness, e.g. 100.
+
| Description      || Temperature in degrees Celsius, e.g. 34°.
|-
 
| Does it require a trigger? || No
 
|}
 
 
 
{| class="wikitable" style="width:100%; text-align:left; border:none; background-color:#f2f2f2; border-radius: 10px; border: 1px solid #ddd;"
 
|-
 
! style="background-color:#1665B0; color:white; width:50%;" | Name
 
! style="background-color:#1665B0; color:white; width:50%;" | Current Brightness (alternative Android 9)
 
|-
 
| Magic text      || {current_brightness_alternative}
 
|-
 
| Description      || Information on the current brightness, e.g. 100.
 
 
|-
 
|-
 
| Does it require a trigger? || No
 
| Does it require a trigger? || No
Line 175: Line 141:
 
|-
 
|-
 
! style="background-color:#1665B0; color:white; width:50%;" | Name
 
! style="background-color:#1665B0; color:white; width:50%;" | Name
! style="background-color:#1665B0; color:white; width:50%;" | Current IP address
+
! style="background-color:#1665B0; color:white; width:50%;" | Bluetooth device name
|-
 
| Magic text      || {ip}
 
|-
 
| Description      || Current IP in 172.217.12.141 format (randomly generated IP).
 
|-
 
| Does it require a trigger? || No
 
|}
 
 
 
{| class="wikitable" style="width:100%; text-align:left; border:none; background-color:#f2f2f2; border-radius: 10px; border: 1px solid #ddd;"
 
|-
 
! style="background-color:#1665B0; color:white; width:50%;" | Name
 
! style="background-color:#1665B0; color:white; width:50%;" | Foreground app
 
|-
 
| Magic text      || {fg_app_name}
 
 
|-
 
|-
| Description      || Name of the application in the foreground, for example, Macrodroid.
+
| Magic text      || {bluetooth_device_name}
 
|-
 
|-
| Does it require a trigger? || No
+
| Description      || Returns the name of the bluetooth device, may be more useful when using the "Any device" option.
|}
 
  
{| class="wikitable" style="width:100%; text-align:left; border:none; background-color:#f2f2f2; border-radius: 10px; border: 1px solid #ddd;"
+
For example, if headphones are connected, it will return the device name.
|-
+
{bluetooth_device_name} = Headphones 1 Pro
! style="background-color:#1665B0; color:white; width:50%;" | Name
 
! style="background-color:#1665B0; color:white; width:50%;" | Foreground package
 
 
|-
 
|-
| Magic text      || {fg_app_package}
+
| Does it require a trigger? || Requires a Bluetooth trigger (device connected or device disconnected) to be present.
|-
 
| Description      || Package of the application in the foreground, for example, com.arlosoft.macrodroid.
 
|-
 
| Does it require a trigger? || No
 
|}
 
 
 
{| class="wikitable" style="width:100%; text-align:left; border:none; background-color:#f2f2f2; border-radius: 10px; border: 1px solid #ddd;"
 
|-
 
! style="background-color:#1665B0; color:white; width:50%;" | Name
 
! style="background-color:#1665B0; color:white; width:50%;" | New Line
 
|-
 
| Magic text      || \n
 
|-
 
| Description      || (Does not require { } or [ ]). It is a special character that marks the end of a line of text and the beginning of a new line. It is used to organize text into a readable and easy-to-read format.
 
For example, Hello world, the output would look like this:
 
Hello
 
world.
 
|-
 
| Does it require a trigger? || No
 
|}
 
 
 
== Magic Text Overview ==
 
 
 
Many triggers, actions, and constraints allow you to configure some text fields. Often, you will find a button next to the text input field that contains the "..." label. This button displays a complete list of "magic text" fields available in the context you are using.
 
 
 
If you want to type them manually instead, if you know them, be aware that there may be spelling/typing errors.
 
 
 
=== How Magic Text Works ===
 
 
 
The magic text allows a different value to be substituted at the point of call, instead of the standard static text that never changes. For example, it's possible to add an action that references a variable via magic text, and that variable's value will be substituted at the point the action is executed.
 
 
 
=== Magic Text Formats ===
 
 
 
Magic text can be written in two ways:
 
* Curly braces: {value}
 
* Square braces: [value]
 
 
 
Curly brackets are not supported on very old versions like v5.20 and below, but it's recommended to use them when interacting with dictionaries/arrays, as square brackets can get confusing very quickly.
 
 
 
=== Magic Text Syntax ===
 
 
 
Magic text for dictionaries/arrays is written like this:
 
 
 
<pre style="background-color: #e9e9e9; border-radius: 5px; padding: 10px;">
 
{lv=dictionary/array name[entry][sub-entry]}
 
</pre>
 
 
 
There can be as many [sub-entry] as you like. Be aware that this can get complicated very quickly! Curly `{}` braces have been added so that users can easily see the beginning and end of a dictionary/array magic text.
 
 
 
 
 
</div>
 
 
 
 
 
 
 
{| class="wikitable" style="width:100%; text-align:left; border:none; background-color:#f2f2f2; border-radius: 10px; border: 1px solid #ddd;"
 
|-
 
! style="background-color:#1665B0; color:white; width:50%;" | Name
 
! style="background-color:#1665B0; color:white; width:50%;" | am/pm
 
|-
 
| Magic text      || {am_pm}
 
|-
 
| Description      || am or pm depending on the time.
 
|-
 
| Does it require a trigger? || No
 
|}
 
 
 
{| class="wikitable" style="width:100%; text-align:left; border:none; background-color:#f2f2f2; border-radius: 10px; border: 1px solid #ddd;"
 
|-
 
! style="background-color:#1665B0; color:white; width:50%;" | Name
 
! style="background-color:#1665B0; color:white; width:50%;" | Android version
 
|-
 
| Magic text      || {android_version}
 
|-
 
| Description      || Returns the number of the android version.
 
|-
 
| Does it require a trigger? || No
 
|}
 
 
 
{| class="wikitable" style="width:100%; text-align:left; border:none; background-color:#f2f2f2; border-radius: 10px; border: 1px solid #ddd;"
 
|-
 
! style="background-color:#1665B0; color:white; width:50%;" | Name
 
! style="background-color:#1665B0; color:white; width:50%;" | Android version (SDK level)
 
|-
 
| Magic text      || {android_version_sdk}
 
|-
 
| Description      || Returns the SDK level of the Android version. e.g. Android 15 has an SDK level of 35.
 
|-
 
| Does it require a trigger? || No
 
|}
 
 
 
{| class="wikitable" style="width:100%; text-align:left; border:none; background-color:#f2f2f2; border-radius: 10px; border: 1px solid #ddd;"
 
|-
 
! style="background-color:#1665B0; color:white; width:50%;" | Name
 
! style="background-color:#1665B0; color:white; width:50%;" | Battery current now (mA)
 
|-
 
| Magic text      || {battery_current_now}
 
|-
 
| Description      || Amount of electrical current flowing from the battery at this moment, measured in milliamps (mA).
 
|-
 
| Does it require a trigger? || No
 
|}
 
 
 
{| class="wikitable" style="width:100%; text-align:left; border:none; background-color:#f2f2f2; border-radius: 10px; border: 1px solid #ddd;"
 
|-
 
! style="background-color:#1665B0; color:white; width:50%;" | Name
 
! style="background-color:#1665B0; color:white; width:50%;" | Battery temp ºC
 
|-
 
| Magic text      || {battery_temp}
 
|-
 
| Description      || Temperature in degrees Celsius, e.g. 34°.
 
 
|}
 
|}
  
Line 322: Line 161:
 
|-
 
|-
 
| Description      || Cell connection type, e.g. 3G, 4G, 5G.
 
| Description      || Cell connection type, e.g. 3G, 4G, 5G.
 +
|-
 +
| Does it require a trigger? || No
 
|}
 
|}
  
Line 333: Line 174:
 
| Description      || Number that identifies an individual cell within a cellular network. Used for mobile phones to connect to the network and for the network to send data to mobile phones
 
| Description      || Number that identifies an individual cell within a cellular network. Used for mobile phones to connect to the network and for the network to send data to mobile phones
 
e.g. The cell identifier for a cell in New York City could be 310-200-0000. The LAC (310-200)
 
e.g. The cell identifier for a cell in New York City could be 310-200-0000. The LAC (310-200)
 +
|-
 +
| Does it require a trigger? || No
 
|}
 
|}
  
Line 343: Line 186:
 
|-
 
|-
 
| Description      || Returns the signal strength that your mobile device is receiving from the nearest cell tower. It is expressed in units called decibels-milliwatts (dBm), with -50 dBm being the strongest signal and -110 dBm being the weakest.
 
| Description      || Returns the signal strength that your mobile device is receiving from the nearest cell tower. It is expressed in units called decibels-milliwatts (dBm), with -50 dBm being the strongest signal and -110 dBm being the weakest.
 +
|-
 +
| Does it require a trigger? || No
 
|}
 
|}
  
Line 354: Line 199:
 
| Description      || Retrieves the text from the clipboard.
 
| Description      || Retrieves the text from the clipboard.
 
If you are on Android 10+ you should have a look at the [https://macrodroidforum.com/wiki/index.php/Action:_Clipboard_Refresh Refresh Cliboard action].
 
If you are on Android 10+ you should have a look at the [https://macrodroidforum.com/wiki/index.php/Action:_Clipboard_Refresh Refresh Cliboard action].
 +
|-
 +
| Does it require a trigger? || No
 
|}
 
|}
  
Line 441: Line 288:
 
|-
 
|-
 
| Does it require a trigger? || No
 
| Does it require a trigger? || No
 +
|}
 +
 +
{| class="wikitable" style="width:100%; text-align:left; border:none; background-color:#f2f2f2; border-radius: 10px; border: 1px solid #ddd;"
 +
|-
 +
! style="background-color:#1665B0; color:white; width:50%;" | Name
 +
! style="background-color:#1665B0; color:white; width:50%;" | Application Launched/Closed
 +
|-
 +
| Magic text      || {app_name}
 +
|-
 +
| Gets the name of the application that was opened or closed according to the context.
 +
|-
 +
| Does it require a trigger? || Yes, it requires an Application Launched/Closed trigger to be present.
 
|}
 
|}

Latest revision as of 17:31, 30 November 2024

Magic Text Overview

Many triggers, actions, and constraints allow you to configure some text fields. Often, you will find a button next to the text input field that contains the "..." label. This button displays a complete list of "magic text" fields available in the context you are using.

If you want to type them manually instead, if you know them, be aware that there may be spelling/typing errors.

How Magic Text Works

The magic text allows a different value to be substituted at the point of call, instead of the standard static text that never changes. For example, it's possible to add an action that references a variable via magic text, and that variable's value will be substituted at the point the action is executed.

Magic Text Formats

Magic text can be written in two ways:

  • Curly braces: {value}
  • Square braces: [value]

Curly brackets are not supported on very old versions like v5.20 and below, but it's recommended to use them when interacting with dictionaries/arrays, as square brackets can get confusing very quickly.

Magic Text Overview

Many triggers, actions, and constraints allow you to configure some text fields. Often, you will find a button next to the text input field that contains the "..." label. This button displays a complete list of "magic text" fields available in the context you are using.

If you want to type them manually instead, if you know them, be aware that there may be spelling/typing errors.

How Magic Text Works

The magic text allows a different value to be substituted at the point of call, instead of the standard static text that never changes. For example, it's possible to add an action that references a variable via magic text, and that variable's value will be substituted at the point the action is executed.

Magic Text Formats

Magic text can be written in two ways:

  • Curly braces: {value}
  • Square braces: [value]

Curly brackets are not supported on very old versions like v5.20 and below, but it's recommended to use them when interacting with dictionaries/arrays, as square brackets can get confusing very quickly.

Magic Text Syntax

Magic text for dictionaries/arrays is written like this:

{lv=dictionary/array name[entry][sub-entry]}

There can be as many [sub-entry] as you like. Be aware that this can get complicated very quickly! Curly `{}` braces have been added so that users can easily see the beginning and end of a dictionary/array magic text.



Name am/pm
Magic text {am_pm}
Description am or pm depending on the time.
Does it require a trigger? No
Name Android version
Magic text {android_version}
Description Returns the number of the android version.
Does it require a trigger? No
Name Android version (SDK level)
Magic text {android_version_sdk}
Description Returns the SDK level of the Android version. e.g. Android 15 has an SDK level of 35.
Does it require a trigger? No
Name Application name
Magic text {app_name}
Description Gets the name of the application that was opened or closed according to the context.
Does it require a trigger? Yes, it requires an Application Launched/Closed trigger to be present.
Name Application package
Magic text {app_package}
Description Gets the name of the application that was opened or closed according to the context.
Does it require a trigger? Yes, it requires an Application Launched/Closed trigger to be present.
Name Battery current now (mA)
Magic text {battery_current_now}
Description Amount of electrical current flowing from the battery at this moment, measured in milliamps (mA).
Does it require a trigger? No
Name Battery temp ºC
Magic text {battery_temp}
Description Temperature in degrees Celsius, e.g. 34°.
Does it require a trigger? No
Name Bluetooth device name
Magic text {bluetooth_device_name}
Description Returns the name of the bluetooth device, may be more useful when using the "Any device" option.

For example, if headphones are connected, it will return the device name. {bluetooth_device_name} = Headphones 1 Pro

Does it require a trigger? Requires a Bluetooth trigger (device connected or device disconnected) to be present.
Name Cell connection type
Magic text {cell_connection}
Description Cell connection type, e.g. 3G, 4G, 5G.
Does it require a trigger? No
Name Cell id
Magic text {cell_id}
Description Number that identifies an individual cell within a cellular network. Used for mobile phones to connect to the network and for the network to send data to mobile phones

e.g. The cell identifier for a cell in New York City could be 310-200-0000. The LAC (310-200)

Does it require a trigger? No
Name Cell tower signal strength
Magic text {cell_signal_strength}
Description Returns the signal strength that your mobile device is receiving from the nearest cell tower. It is expressed in units called decibels-milliwatts (dBm), with -50 dBm being the strongest signal and -110 dBm being the weakest.
Does it require a trigger? No
Name Clipboard text
Magic text {clipboard}
Description Retrieves the text from the clipboard.

If you are on Android 10+ you should have a look at the Refresh Cliboard action.

Does it require a trigger? No
Name Current battery %
Magic text {battery}
Description Information on the current battery charge percentage, e.g. 80%.
Does it require a trigger? No
Name Current Brightness
Magic text {current_brightness}
Description Information on the current brightness, e.g. 100.
Does it require a trigger? No
Name Current Brightness (alternative Android 9)
Magic text {current_brightness_alternative}
Description Information on the current brightness, e.g. 100.
Does it require a trigger? No
Name Current IP address
Magic text {ip}
Description Current IP in 172.217.12.141 format (randomly generated IP).
Does it require a trigger? No
Name Foreground app
Magic text {fg_app_name}
Description Name of the application in the foreground, for example, Macrodroid.
Does it require a trigger? No
Name Foreground package
Magic text {fg_app_package}
Description Package of the application in the foreground, for example, com.arlosoft.macrodroid.
Does it require a trigger? No
Name New Line
Magic text \n
Description (Does not require { } or [ ]). It is a special character that marks the end of a line of text and the beginning of a new line. It is used to organize text into a readable and easy-to-read format.

For example, Hello world, the output would look like this: Hello world.

Does it require a trigger? No
Name Application Launched/Closed
Magic text {app_name}
Gets the name of the application that was opened or closed according to the context.
Does it require a trigger? Yes, it requires an Application Launched/Closed trigger to be present.