(Spotify magic text added)
(Added SMS received)
Line 48: Line 48:
 
[bluetooth_device_name] = Headphones 1 Pro
 
[bluetooth_device_name] = Headphones 1 Pro
  
 +
</pre><br>
 +
 +
=== SMS received ===
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 +
This magic text appears when using any variation of "SMS received".
 +
 +
[sms_name] - Sender name.
 +
 +
[sms_message] - SMS content.
 +
 +
[sms_number] - SMS sender number.
 +
 +
For example, if you receive an SMS from "Macrodroid user"
 +
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>
  
Line 53: Line 76:
 
<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.
[spotify_artist] - Returns the artist of the song.
+
 
[spotify_album] - Returns the album of the song.
+
[spotify_artist] - Returns the artist of the song, "Started music" is not supported
[spotify_track] - Returns the name of the song.
+
 
 +
[spotify_album] - Returns the album of the song, "Started music" is not supported
 +
 
 +
[spotify_track] - Returns the name of the song, "Started music" is not supported
 +
 
 
[spotify_length_s] - Returns the length of the song in seconds.
 
[spotify_length_s] - Returns the length of the song in seconds.
 +
 
[spotify_is_playing]- Returns a boolean state (true or false).
 
[spotify_is_playing]- Returns a boolean state (true or false).
 
</pre><br>
 
</pre><br>

Revision as of 17:39, 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

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

[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".


Apllication Launched/Closed

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

[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".


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

[call_number] - Returns the number from which the call was received.

[call_name] - Returns the name from where the call was received if available.

For example, if you receive a call from 1234567890 registered as MacroDroid user
[call_number] = 1234567890
[call_name] = MacroDroid user


Bluethooth (Device connected or device disconnected)

[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


SMS received

This magic text appears when using any variation of "SMS received".

[sms_name] - Sender name.

[sms_message] - SMS content.

[sms_number] - SMS sender number.

For example, if you receive an SMS from "Macrodroid user"
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


Spotify

[spotify_track_id] - Returns the Track ID of the song.

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

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

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

[spotify_length_s] - Returns the length of the song in seconds.

[spotify_is_playing]- Returns a boolean state (true or false).



Does not require a trigger to operate

Does not depend on a trigger

MacroDroid Mode

Texto de la subsección 2.1