Line 14: Line 14:
 
Magic text can be written in 2 ways : Curly brackets {value} and square brackets [value]. Curly brackets aren't supported on very old versions like v5.20 and below but it's recommended to use it when interacting with dictionaries/arrays as with square brackets it can get confusing where you are very quickly.
 
Magic text can be written in 2 ways : Curly brackets {value} and square brackets [value]. Curly brackets aren't supported on very old versions like v5.20 and below but it's recommended to use it when interacting with dictionaries/arrays as with square brackets it can get confusing where you are very quickly.
 
</pre>
 
</pre>
 
__TOC__
 
  
 
==<p><b>Requires a trigger to operate</b></p>==
 
==<p><b>Requires a trigger to operate</b></p>==
Line 54: Line 52:
  
 
=== Call (Active, Ended, Incoming, Missed, Outgoing) ===
 
=== Call (Active, Ended, Incoming, Missed, Outgoing) ===
* '''''Call number'''''
+
* '''''Call name'''''
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">[call_number]
+
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">[call_name]
 
Returns the number from which the call was received.
 
Returns the number from which the call was received.
 
e.g. If you receive a call from MacroDroid user
 
e.g. If you receive a call from MacroDroid user
Line 61: Line 59:
 
[call_name] = MacroDroid user
 
[call_name] = MacroDroid user
 
</pre><br>
 
</pre><br>
* '''''Call name'''''
+
* '''''Call number'''''
 
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
[call_name]
+
[call_number]
 
Returns the name from where the call was received if available.
 
Returns the name from where the call was received if available.
  
For example, if you receive a call from 1234567890
+
e.g. If you receive a call from 1234567890
 
[call_number] = 1234567890
 
[call_number] = 1234567890
 
</pre><br>
 
</pre><br>
Line 72: Line 70:
 
=== SMS received ===
 
=== SMS received ===
 
* '''''Incoming SMS contact'''''
 
* '''''Incoming SMS contact'''''
'''''This magic text appears when using any variation of "SMS received"'''''.
 
 
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
+
[sms_name] - Name of the person sending the SMS (the sender must be in your contact list).
[sms_name] Name of the person sending the SMS (the sender must be in your contact list).
+
e.g. If you receive an SMS from Macrodroid user
 +
[sms_name] = Macrodroid user
 
</pre><br>
 
</pre><br>
 
* '''''Incoming SMS message'''''
 
* '''''Incoming SMS message'''''
 
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
[sms_message] - Contains the text of the sms.
 
[sms_message] - Contains the text of the sms.
 +
e.g. If you receive an SMS with a message "Hello, have a nice day"
 +
[sms_message] = Hello, have a nice day
 
</pre><br>
 
</pre><br>
 
+
* '''''Incoming SMS number'''''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
[sms_number] - SMS sender number.
 
[sms_number] - SMS sender number.
 
+
e.g. If you receive an SMS from +1 1234567890
For example, if you receive an SMS from "Macrodroid user"
+
[sms_number] = +1 1234567890
the message "Hello, have a nice day"
 
comes from the phone number +1 12345678
 
 
 
the magic text would return this:
 
 
 
[sms_name] = Macrodroid user
 
 
 
[sms_message] = Hello, have a nice day
 
 
 
[sms_number] =+1 12345678
 
 
</pre><br>
 
</pre><br>
 
 
=== Logcat ===
 
=== Logcat ===
 +
* '''''Logcat entry line'''''
 
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
[logcat_line] - Returns the reference logcat line configured in the trigger.
 
[logcat_line] - Returns the reference logcat line configured in the trigger.
Line 103: Line 94:
  
 
=== Notifications ===
 
=== Notifications ===
 +
* '''''Notification title'''''
 
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
[not_title] - Notification title.
+
[not_title] - is a prominent text element that concisely summarizes the key subject or purpose of a notification.
 
+
</pre><br>
[not_ticker] - Notification ticker text, is a brief text that scrolls temporarily across the status bar of an Android device when a new notification arrives. This feature was removed in Android 5.0 Lollipop, but it can still be found on some devices or restored using third-party apps.
+
* '''''Notification ticker text'''''
 
+
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
[notification] - Notification text.
+
[not_ticker] - is a brief text that scrolls temporarily across the status bar of an Android device when a new notification arrives. This feature was removed in Android 5.0 Lollipop, but it can still be found on some devices or restored using third-party apps.
 
+
</pre><br>
[not_sub_text] - Notification sub text,  is a secondary text element that provides additional context or detail to a notification.
+
* '''''Notification text'''''
 
+
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
[not_text_lines] - Notification big text, is a feature that allows to display a more significant amount of text within a notification.
+
[notification] - is the text displayed in a notification. It is the main part of the notification and usually contains information about the content of the notification.
 
+
</pre><br>
[not_action_names] - Notification actions names, are clickable buttons or links embedded within notifications that allow users to perform specific tasks directly without opening the associated app.
+
* '''''Notification sub text'''''
 
+
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
[not_app_name] - Notification app name,  is the name of the app that generated the notification.
+
[not_sub_text] - is a secondary text element that provides additional context or detail to a notification.
 
+
</pre><br>
[not_app_package] - Notification app package, It is the package name of the application that created the notification.
+
* '''''Notification big text'''''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 +
[not_text_lines] - is a feature that allows to display a more significant amount of text within a notification.
 +
</pre><br>
 +
* '''''Notification actions names'''''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 +
[not_action_names] - are clickable buttons or links embedded within notifications that allow users to perform specific tasks directly without opening the associated app.
 +
</pre><br>
 +
* '''''Notification app name'''''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 +
[not_app_name] - is the name of the app that generated the notification.
 +
</pre><br>
 +
* '''''Notification app package'''''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 +
[not_app_package] - is the package name of the application that created the notification.
 
</pre><br>
 
</pre><br>
 
 
=== Spotify ===
 
=== Spotify ===
 +
* '''''Spotify track id'''''
 
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
[spotify_track_id] - Returns the Track ID of the song.
 
[spotify_track_id] - Returns the Track ID of the song.
 
+
</pre><br>
 +
* '''''Spotify artist'''''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
[spotify_artist] - Returns the artist of the song, "Started music" is not supported
 
[spotify_artist] - Returns the artist of the song, "Started music" is not supported
 
+
</pre><br>
 +
* '''''Spotify album name'''''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
[spotify_album] - Returns the album of the song, "Started music" is not supported
 
[spotify_album] - Returns the album of the song, "Started music" is not supported
 
+
</pre><br>
 +
* '''''Spotify track name'''''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
[spotify_track] - Returns the name of the song, "Started music" is not supported
 
[spotify_track] - Returns the name of the song, "Started music" is not supported
 
+
</pre><br>
 +
* '''''Spotify length (s)'''''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
[spotify_length_s] - Returns the length of the song in seconds.
 
[spotify_length_s] - Returns the length of the song in seconds.
 
+
</pre><br>
 +
* '''''Spotify is playing'''''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
[spotify_is_playing]- Returns a boolean state (true or false).
 
[spotify_is_playing]- Returns a boolean state (true or false).
 
</pre><br>
 
</pre><br>
 
 
=== Weather ===
 
=== Weather ===
 +
* '''''Temperature (Celsius)'''''
 
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
{weather_temperature_c} - Temperature (Celsius).
 
{weather_temperature_c} - Temperature (Celsius).
 
+
</pre><br>
 +
* '''''Temperature (Temperature (fahrenheit)'''''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
{weather_temperature_farenheit} - Temperature (fahrenheit).
 
{weather_temperature_farenheit} - Temperature (fahrenheit).
 
+
</pre><br>
 +
* '''''Wind speed m\s'''''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
{weather_wind_speed} - Wind speed m\s.
 
{weather_wind_speed} - Wind speed m\s.
 
+
</pre><br>
 +
* '''''Wind speed (mph)'''''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
{weather_wind_speed_mph} - Wind speed (mph).
 
{weather_wind_speed_mph} - Wind speed (mph).
 
+
</pre><br>
 +
* '''''Wind speed (kmh)'''''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
{weather_wind_speed_kmh} - Wind speed (kmh).
 
{weather_wind_speed_kmh} - Wind speed (kmh).
 
+
</pre><br>
 +
* '''''Temperature Wind direction'''''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
{weather_wind_direction} - Wind direction (degrees).
 
{weather_wind_direction} - Wind direction (degrees).
 
+
</pre><br>
 +
* '''''Humidity'''''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
{weather_humidity} - Humidity.
 
{weather_humidity} - Humidity.
 
+
</pre><br>
 +
* '''''Weather conditions'''''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
{weather_conditions} - Weather conditions.
 
{weather_conditions} - Weather conditions.
 
 
</pre><br>
 
</pre><br>
  

Revision as of 21:46, 2 January 2024

About

In many triggers, actions and constraints you will have the option to configure some textual fields. Often you will find a button next to the text entry field that contains the "..." label. This button will display a complete list of "magic text" fields that are available in the context that is being used.

If you wish to manually type them instead if you know them, be aware that there can be spelling/typing mistakes.

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 want. Be aware that it can get complicated pretty fast! Curly {} brackets were added so users would see the beginning and end of a dictionary/array magic text 
with ease.

The magic text allows some other value to be substituted at the point of invocation, rather than standard static text that will never changed. For example it's possible to add and action that reference a variable via magic text and that variable's value will be substituted at the point that action is run.

Magic text can be written in 2 ways : Curly brackets {value} and square brackets [value]. Curly brackets aren't supported on very old versions like v5.20 and below but it's recommended to use it when interacting with dictionaries/arrays as with square brackets it can get confusing where you are very quickly.

Requires a trigger to operate

App Install/Remove/Update

  • Application name
 [app_name]
Returns the name of the application that was launched, for example "MacroDroid".


  • Application package
[app_package]
Returns the package name of the application that was launched, for example, if it were MacroDroid the response would be "com.arlosoft.macrodroid".


Application Launched/Closed

  • Application name
[app_name]
Returns the name of the application that was launched, for example "MacroDroid".


  • Application package
[app_package]
Returns the package name of the application that was launched, for example, if it were MacroDroid the response would be "com.arlosoft.macrodroid".


Bluethooth (Device connected or device disconnected)

  • Bluetooth device name
[bluetooth_device_name]
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


Call (Active, Ended, Incoming, Missed, Outgoing)

  • Call name
[call_name]
Returns the number from which the call was received.
e.g. If you receive a call from MacroDroid user

[call_name] = MacroDroid user


  • Call number
[call_number]
Returns the name from where the call was received if available.

e.g. If you receive a call from 1234567890
[call_number] = 1234567890


SMS received

  • Incoming SMS contact
[sms_name] - Name of the person sending the SMS (the sender must be in your contact list).
e.g. If you receive an SMS from Macrodroid user
[sms_name] = Macrodroid user


  • Incoming SMS message
[sms_message] - Contains the text of the sms.
e.g. If you receive an SMS with a message "Hello, have a nice day"
[sms_message] = Hello, have a nice day


  • Incoming SMS number
[sms_number] - SMS sender number.
e.g. If you receive an SMS from +1 1234567890
[sms_number] = +1 1234567890


Logcat

  • Logcat entry line
[logcat_line] - Returns the reference logcat line configured in the trigger.


Notifications

  • Notification title
[not_title] - is a prominent text element that concisely summarizes the key subject or purpose of a notification.


  • Notification ticker text
[not_ticker] - is a brief text that scrolls temporarily across the status bar of an Android device when a new notification arrives. This feature was removed in Android 5.0 Lollipop, but it can still be found on some devices or restored using third-party apps.


  • Notification text
[notification] - is the text displayed in a notification. It is the main part of the notification and usually contains information about the content of the notification.


  • Notification sub text
[not_sub_text] - is a secondary text element that provides additional context or detail to a notification.


  • Notification big text
[not_text_lines] - is a feature that allows to display a more significant amount of text within a notification.


  • Notification actions names
[not_action_names] - are clickable buttons or links embedded within notifications that allow users to perform specific tasks directly without opening the associated app.


  • Notification app name
[not_app_name] - is the name of the app that generated the notification.


  • Notification app package
[not_app_package] - is the package name of the application that created the notification.


Spotify

  • Spotify track id
[spotify_track_id] - Returns the Track ID of the song.


  • Spotify artist
[spotify_artist] - Returns the artist of the song, "Started music" is not supported


  • Spotify album name
[spotify_album] - Returns the album of the song, "Started music" is not supported


  • Spotify track name
[spotify_track] - Returns the name of the song, "Started music" is not supported


  • Spotify length (s)
[spotify_length_s] - Returns the length of the song in seconds.


  • Spotify is playing
[spotify_is_playing]- Returns a boolean state (true or false).


Weather

  • Temperature (Celsius)
{weather_temperature_c} - Temperature (Celsius).


  • Temperature (Temperature (fahrenheit)
{weather_temperature_farenheit} - Temperature (fahrenheit).


  • Wind speed m\s
{weather_wind_speed} - Wind speed m\s.


  • Wind speed (mph)
{weather_wind_speed_mph} - Wind speed (mph).


  • Wind speed (kmh)
{weather_wind_speed_kmh} - Wind speed (kmh).


  • Temperature Wind direction
{weather_wind_direction} - Wind direction (degrees).


  • Humidity
{weather_humidity} - Humidity.


  • Weather conditions
{weather_conditions} - Weather conditions.


Does not require a trigger to operate

Does not depend on a trigger

MacroDroid Mode

Texto de la subsección 2.1