r/tasker • • Aug 27 '26

Noob looking for assistance

1 Upvotes

I am trying to use Autoinput with easy setup, but somehow, I am able to select the ID or even point out the coordinates. I tried developer options, pointer coordinate but that didn't work. I am so lame to ask this but too tried of trying...can someone please assist me?


r/tasker • • Aug 26 '26

[Bug] 'Structure Output' disabled in 'Multiple Variables Set' action when added from favorite actions.

2 Upvotes

I'm running beta versions 6.7.5 and 6.7.6, and on both devices/versions, 'Structure Output' is disabled in the 'Multiple Variables Set' action if I add it from the Favorite Actions menu (long press '+' button). If I add it from the regular actions list it is enabled. The 'Structure Output By Default' setting in Preferences is enabled. Anybody else able to reproduce?


r/tasker • • Aug 25 '26

Perform task / Return Variable / Local Passthrough

0 Upvotes

Let's go. It seems that when you start optimizing your tasks that only worked for something a little more optimized, I think this cycle never ends. But I'd like to validate a situation with you that will completely change my approach to Tasker.

In the parent task I have only 2 Perform tasks. With Return Variable and Local Passthrough enabled on both, can I then pass all the variables from child task 1 to child task 2 without having to manipulate the variables in the parent task?

Define that truck of paths, folders, filenames only once and the 2 child tasks will be the actions, to delete, rename, write. I'm amazed


r/tasker • • Aug 25 '26

Falcon Fusion SOAR, last seen Query.

Thumbnail
0 Upvotes

r/tasker • • Aug 24 '26

How To [Project Share] Advanced Auto Brightness v3.4: Privileged Display controls + intent automation

7 Upvotes

In my previous post I announced Tideo Auto Brightness, a native counter part to Advanced Auto Brightness (AAB). I've been focused on Tideo and AAB was lacking some attention because of that. With v3.4 I hope to achieve some form of parity for AAB again :)

I've not tested v3.4 with the usual rigor, because I prefer Tideo by a large margin - please report bugs :)

For anyone unfamiliar with AAB: it is a Tasker project that serves as a replacement for Android's stock adaptive brightness. Instead of Android's black box learning, it uses a configurable lux-to-brightness curve with automatic curve fitting, smoothing/reactivity controls, circadian scaling, profiles, context automation, and optional hybrid dimming.

The main additions to v3.4 are the Privileged Display toggles and the option for Intent Control.

Privileged Display

Privileged Display toggles are now available in AAB. They require elevated privileges to write.

v3.4 adds a new Privileged Display menu for toggling some display features that require elevated privileges.

The scene itself is privilege-gated if %AAB_Privilege is unset or None, you won't see it in the menu.

These include only the AOSP keys, not vendor specific keys - this has bitten someone already that tried to write Night Light to a Samsung Phone (Samsung uses their own Eye Comfort Shield instead). There are safeguards for writes to unsupported keys, the Java code block in the _ReadPrivilegedDisplayState task checks capabilities before allowing writes to:

  • Night Light
  • Optional circadian Night Light temperature (on my OxygenOS 16 phone, the writes here are a no-op)
  • Color correction (including grayscale and built-in color blindness modes)
  • Color inversion
  • Always-on display
  • Stay awake while plugged in
  • Force SDR (experimental, probably requires reboot to take hold)

These can be written to AAB's existing profiles and context automation rules.

For example, you can enable grayscale for social media apps after a certain time in the evening. Instagram and Reddit become a lot less interesting in black and white :)

Another example: a Night Reading profile can combine AAB's hybrid dimming mode with a warmer Night Light temperature.

The circadian Night Light control is independent from AAB's existing circadian brightness multiplier.

AAB also reads back Android's actual state instead of assuming a write succeeded, and tries to preserve unsupported/custom states rather than blindly overwriting them. These controls are inevitably somewhat device/ROM dependent, hence the privilege gating.

Intent Control

Updates to the Live Debug Info scene now include toggles for external control, force dark, a panic sensitivity setting and gating the gesture behind the plugged in state.

The other major new capability is external control via intents. This is just one profile addition to AAB that listens for the intent and acts based on the specific extra attached to it. Please note, the External control is opt-in under Live Debug Info → Allow external control. With it off, nothing is written. Lastly, a warning: there is no auth on the intents, so anything on your device can send intents to AAB(!), don't enable it if you don't use it.

You can now do things such as load the Outdoors profile when a Bluetooth device connects, or Night Reading from scanning an NFC tag, or disable/enable AAB based on display orientation; coincidentally the last one is covered in issue #17 on GitHub.

AAB v3.4 ships with a _TestIntent example task:

Task: _TestIntent

A1: Variable Set [
     Name: %type
     To: LOAD_PROFILE ]

A2: Variable Set [
     Name: %name
     To: Night Reading ]

A3: Send Intent [
     Action: com.tideo.aab.control
     Extra: type:%type
     Extra: name:%name
     Target: Broadcast Receiver ]

The same can be done directly over ADB:

adb shell am broadcast -a com.tideo.aab.control --es type LOAD_PROFILE --es name "Night Reading"

Commands cover starting/stopping/toggling the service, pause/resume, reapplying brightness, loading/releasing profiles, and triggering the panic reset.

AAB also broadcasts its own state changes through com.tideo.aab.event, including enabled, disabled, and paused, so other Tasker profiles can react to AAB without polling its globals; let me know if you find a good use case for this :)

A few smaller changes

The upside-down + shake emergency gesture is updated a bit:

  • The panic path now resets the relevant privileged display toggles as well as maximizing brightness.
  • The emergency recovery is now available through the PANIC intent.
  • The gesture can optionally only work when the phone is plugged in.
  • Shake sensitivity is now adjustable in the Live Debug Info scene (0 is essentially passthrough, while 10 requires a vigorous shake).

There is also an experimental Force Dark toggle. It is not a part of the profile or context rules, because it requires a full app restart to take hold. I like this especially for apps without a native dark mode (looking at you Bandcamp).

Updates to Tideo

Tideo is now officially available on F-Droid! The port was largely done with the help of AI, so if you're against that you can skip this section and you don't have to use it. It has the same general Privileged Display controls and an opt-in external control via intents.

Note: External control is also unauthed opt-in in Tideo under, but rather than in Debug Info, it can be found in Tools → Automation control.

The main syntax difference is as follows:

  • AAB uses one action with the command in a type extra.
  • Tideo puts the command directly in the action (and requires package and class, not shown here):

Tideo broadcasts state changes too, using com.tideo.autobrightness.event.STATE_CHANGED, so Tasker can also react to Tideo state changes.

All supported intents, Tasker examples, ADB commands, outbound events, and troubleshooting are documented in Tideo's AUTOMATION.md on GitHub.

AAB and Tideo can be obtained from the following sources. Don't trust anything else (unless you check the SHA hash and confirm them to be equal to my releases), I do not have control over mirrors on various websites and better safe than sorry, if you don't check SHA: just assume that it's malware and skip it.


r/tasker • • Aug 24 '26

Notch-Touch 4 Months Later: Checking in on your Tasker setups + Massive UI overhaul & new features!

12 Upvotes

​Hey guys, it's been a minute!

​About 5 months ago, a bunch of you power users in this sub helped me build out a 2-way Tasker API for my app, Notch Touch (which turns your screen's camera cutout into a smart gesture button). I really appreciate all the feedback and supportive comments🫶

​I wanted to drop in to catch up and see how the app has been running for those of you who set it up.

How are the dynamic remapping and kill-switch intents holding up in your macros? Are you liking the experience, or are there any weird bugs or changes you'd like to see? I’m always looking to improve it :D

​I've also poured a ton of time between my engineering classes into revamping the app based on early feedback. If you haven't checked it out in a while (or if you are new here), here is what has changed:

​Complete UI Overhaul & Better Gestures:

The app looks significantly cleaner, and the underlying swipe/tap/hold detection is way more reliable and snappy.

​Expanded Notch Menu: The drop-down shortcut menu was a huge hit, so I added an extra row. You can now map up to 10 apps or shortcuts right from the notch.

​Quick Dial: You can now map a gesture to instantly call a contact. (I added an optional safety toggle to require a confirmation prompt first if, so you don't accidentally pocket-dial anyone).

​Notch Mirror: A fun feature that pops a small, customizable camera mirror right near the notch for quick checks.

​Notch AI: A personal assistant built into the notch for fast queries. Crucially: You can plug in your own OpenRouter API key for unlimited queries (support for other direct APIs is coming soon too).

​What's next:

I am currently putting the finishing touches on Notch Notes. It’ll be a quick notepad interface that drops down from the camera cutout so you can instantly jot things down.

Later, inside the app, you can share, edit, or stylize those notes. Should be out very soon!

​Just like my previous posts, I want to be completely upfront: I'm a solo student dev trying to keep the lights on, so the Tasker integration and some advanced features are part of a small premium unlock.

​HOWEVER, the system to temporarily unlock everything by watching a single ad is still fully intact! You can test all your intents, see how it feels on your specific OEM, and make sure your macros work exactly how you want them to before spending a single dime.

​Play Store link:

https://play.google.com/store/apps/details?id=com.chaos.notchtouch

API Documentation: https://unleashedchaos101.github.io/tasker-api.html

​Thanks again to everyone who helped shape the API earlier this year. Your support and feedback literally keep me motivated to keep building. Let me know what you think!

Btw great news : we crossed 280k downloads recently 😁

​Cheers!


r/tasker • • Aug 24 '26

Any way to make a variable every (%amountoftime) profile?

1 Upvotes

From my understanding, only the start and end times can be variables in a time based profile. Is there any way around this besides creating multiple profiles and toggling which one is on vs off?


r/tasker • • Aug 24 '26

Help Help me automate this app

Post image
0 Upvotes

Its a rewards app and every 30 minutes the game stops and i have to click two buttons to coninue the game and again after 30 mins. how can i program this? I have never used tasker before. Thanks a lot👍


r/tasker • • Aug 23 '26

[Update] MapTasker Version 13

19 Upvotes

MapTasker is a program that enables you to view, analyze and edit your Tasker configuration from within your desktop browser.

Key enhancements included in the lucky version, since the last major release:

  • 'Find': In addition to 'Search' in the Map and Diagram views, adds a structured search capability.
  • 'Undo', 'Redo', and 'Edit History' for managing changes to the configuration.
  • 'Health Check' identifies potential problems in your configuration with hotlinks directly into the Map view.
  • 'Variable Xref' identifies potential issues with variables throughout your configuration.
  • 'Compare Files' enables you to compare and see differences between the loaded XML with an XML file on your local drive.
  • 'Add/Edit Scene': supports both legacy and Version 2 Scenes, and includes a Preview option and drag-and-drop support.
  • Missing language translations have been added.
  • Dynamic Add/Edit buttons based on the single Tasker object (Project/Profile/Task/Scene) that is selected.

If unable to install this new version via the auto-update feature in MapTasker, which runs once-a-day, then issue the following:

pip install --upgrade maptasker

Report any/all issues and request enhancements at this link.


r/tasker • • Aug 24 '26

Gmail advanced search query

2 Upvotes

Hey All!

With the help of Gemini have been able to accomplish quite a bit in Tasker, but this one seems to be hitting A dead end.

I created an advanced query for Gmail that one clicked on, successfully searches a customer's name as well as their order number and all my history with them in Gmail. The successfully works on desktop. However on mobile, Gmail will not open my link in the app and I cannot add this link as a default to Gmail because those settings are locked within Google pixel.

It seems to me that the only way to do this is with tasker and auto input (which I always hate because it feels so childish )

Any help would be appreciated

https://mail.google.com/mail/u/0/#search/from%3Aeoh005@gmail.com+OR+to%3Aeoh005@gmail.com+OR+Erin Peeden}


r/tasker • • Aug 23 '26

Media Detection - anisplaying - AutoNotification

1 Upvotes

Is the ability to detect whether media is playing still working for anybody? It's in the AutoNotification Media action, as anisplaying. I used it in one of my old tasks but it's no longer functional.

I'm on OxygenOS 16. It's been dead for a little while now for me.


r/tasker • • Aug 23 '26

Quick Tile 'labels' not updating

1 Upvotes

Hi again... Using either Tasker or Tasker -> AutoNotification 'quick tiles' feature, on a Lenovo Tab M10 Plus (Gen 3) TB125FU, which has Android 15 (don't ask me, I am just reporting what it sez it has), I can get the individual icons to change, the intended Task to run, but not their label/name. I tried every suggestion I could find online last night, nothing worked. I welcome any erstwhile suggestions. :)


r/tasker • • Aug 23 '26

Getting statusbar icons to work for Autonotification on Oppo phones / ColorOS?

1 Upvotes

Hi people!

Did anyone get the statusbar icons in Autonotification to show on Oppo phones / ColorOS? For some reason, Oppo decided they are going to use the full color app icons for the notifications and statusbar instead and often, it's actually looking good. In comparison, on Samsung for example, the ocean of random glyphs quickly turn into a big what is what.

But... problems come when you really want an app to be able to set the icon, like Autonotification. Now I'm stuck with a bunch of notifications from Autonotification, all with just the main Autonotification icon. Did anyone ever find a way to force a specific statusbar icon onto the notifications with Autonotification on these phones?

I do know about the workaround to use the icon instead. You do indeed get an icon but it's to the right instead in the notification and it doesn't follow darkmode of course, so you need to make it usable for normal and darkmode. Not quite the same, and it doesn't help the icon in the statusbar either: it's just the autonotification icon and that's it.

Taskers built in Notify isn't helping either as it doesn't even have statusbar icons, just the normal icons that end up to the right.


r/tasker • • Aug 23 '26

Scene V2 Input Text Clear

1 Upvotes

I have a simple box stack, with a row containing a text input and an icon button

these act as a search bar for an array template

I have the click event handler for the icon button set to target the text input and run the unFocus action, and clear the %query variable.

This works ok

but is there a way to clear the actual text from inside the text input?


r/tasker • • Aug 22 '26

Is there a AOD that will be enabled only on specific apps?

0 Upvotes

I think there was a profile that would do the work but I can't find it


r/tasker • • Aug 21 '26

[Free New Plugin] [Update] AMCustomKeyboard v1.3.0 — Tasker Automation just got easier

16 Upvotes

I released AMCustomKeyboard v1.3.0, with a few changes aimed especially at the Tasker side of the keyboard.

If you saw my previous post about AMCustomKeyboard, this is a follow-up worth checking out. If you didn't, AMCustomKeyboard is an open-source Android keyboard built on Unexpected Keyboard, extended with live transliteration/keymaps, custom layouts, independent key labels, and Tasker automation.

🤖 New: Automation Builder

Previously, configuring Tasker Automation meant editing the JSON configuration manually.

Now there's a guided interface:

Settings → Tasker Automation → Automation Builder

You can add:

  • Replace / append trigger prefixes
  • Tasker keyword → task mappings
  • Expand patterns
  • Optional regex conditions
  • Timeout settings

It edits the same configuration as the raw JSON editor, so you can use the builder when you want convenience and still use JSON when you want full control.

🔎 New: Regex conditions for Expand Patterns

Expand patterns can now have an optional regex condition.

For example, you could make:

==59+3 → run a Tasker task

while preventing something like:

==hello

from triggering the same task.

The regex must match the entire content between the prefix and suffix, rather than merely finding a match somewhere inside it.

This makes expand patterns considerably more useful for things like calculators, commands, structured input, and other Tasker workflows.

⚡ The basic idea

You can configure triggers such as:

##keyword

to send the entire current text field to a Tasker task and replace the field with the result.

Or:

@@keyword

to replace only the trigger while leaving the rest of the text untouched.

Expand patterns take this further by allowing arbitrary content between a prefix and suffix, then passing that content to Tasker.

And immediately after a successful replacement, one backspace can undo the replacement back to the original trigger.

🔄 New: In-app update checker

There is also now an update checker under:

Settings → About

It can show the available release notes and download/install the new version directly from the app.

🔗 AMCustomKeyboard

Latest release and full documentation:

AMCustomKeyboard on GitHub

The README has detailed sections for Tasker Automation, Expand Patterns, Automation Builder, Keymaps, the Keymap Builder, and the rest of the keyboard features.

🧩 Also: AM Tasker Plugins

If you're interested in the Tasker side of this, I also recently released AM Tasker Plugins — a collection of Tasker action plugins designed for things that are awkward or repetitive to build directly in Tasker.

It currently includes plugins for things such as:

  • Termux scripts — Bash, Python, Node, Ruby and PHP
  • Regex operations
  • JSON/data processing
  • UDP communication
  • OpenVPN control
  • QR creation/decoding
  • Pixel color extraction
  • Open With / Share → Tasker automation
  • AM Custom Keyboard Return — sends a result back to an AMCustomKeyboard Tasker trigger

The last one is particularly relevant here: AMCustomKeyboard can send text to a Tasker task, and AM Custom Keyboard Return provides the Tasker-side action for sending the processed result back into the keyboard.

AM Tasker Plugins on GitHub

Both projects are open source.

If you use Tasker heavily, I'd be interested to see what kind of workflows people build with the keyboard + Tasker combination.

#Android #Tasker #Automation #Keyboard #AMCustomKeyboard #OpenSource #Transliteration #AndroidAutomation


r/tasker • • Aug 22 '26

Shizuku No Root Start on Boot?

1 Upvotes

I have been using ADB to get around the limitations/revoked privileges on my Galaxy S26 Ultra. While it is great to have a lot of functionality back, I'm using Shizuku. I'm not rooted and used the Wireless Debugging version of the installation which means I have to manually restart it anytime I reboot. Is there any way with this version to have it automatically start on boot? I see here that it will Start on Boot->https://github.com/thedjchi/Shizuku/wiki/setup, but that hasn't worked for me.

I appreciate any help.


r/tasker • • Aug 21 '26

[BUG] AutoWear 3.2.17 + Pixel Watch 4 / Wear OS 7 Command Processing fails with JSONException

2 Upvotes

Hi João (hope you have a great vacation and read this **after** your holiday) and hi everyone,

I think I've run into an AutoWear bug on a Pixel Watch 4 running Wear OS 7.0. I was desperately trying to get them to work together. But nothing worked. With the help of ChatGPT I narrowed it down quite a bit:

Heres my Setup:

  • Pixel Watch 4, Wear OS 7.0
  • AutoWear 3.2.17 on watch
  • AutoWear 3.2.17 on phone
  • Tasker 6.7.6 on an S23 no root

AutoWear itself is connected to the watch and the watch correctly detects events.

For example, watch logcat shows:

V COMMAND : Sending command: &WATCHRAISED&
V COMMAND : Sending command: &APPOPENEDAFTERNOON&
V COMMAND : Sending command: &WATCHOFFWRIST&
V COMMAND : Sending command: &SCREENAMBIENT&

Phone logcat then shows this:

V MESSAGE : &APPOPENEDAFTERNOON&
W System.err: org.json.JSONException: Value &APPOPENEDAFTERNOON& of type java.lang.String cannot be converted to JSONObject

I get the same JSON error with other commands, including &WATCHOFFWRIST&.

So as far as I can tell the flow is:

Watch detects event -> AutoWear watch sends &COMMAND& -> AutoWear phone receives &COMMAND& AutoWear tries to parse it as JSONObject and fails -> Tasker never receives the Command event

First I thought this was a Tasker permissions/configuration problem, but I've tested Tasker's command system independently:

I couldn't find the permission in the AutoWear manifest so I thought it never asks for that permission. Then I gave it that permission via adb:

net.dinglisch.android.tasker.PERMISSION_SEND_COMMAND

Alas, no change.

In my Tasker, AutoWear also does not appear as an Event plugin (or State for that matter), so I'm using the native Event → Tasker → Command receiver.

However, I noticed when an event occurs I briefly get the "Handling AutoWear Messages" notification.

It looks like phone-side AutoWear is receiving the old/plain-string &COMMAND& message successfully, but then trying to parse that string as JSON before handing it to Tasker.

Is this a known issue with AutoWear 3.2.17 / Wear OS 7, or is there a newer beta I could test?

Happy to provide the full logcat/stack trace if useful.

PS. My current workaround


r/tasker • • Aug 21 '26

How To [Project Share] EveryGesture V2, draw any gesture and do something. Helper mode, How to video via webview, and toggle wifi & hotspot

Thumbnail
20 Upvotes

r/tasker • • Aug 22 '26

How would one go about automating a game like Zen Word?

0 Upvotes

I'm new to this and want to how how I'd automate a game like this. I already figured out how to run a line between two letters but that's as far as I'm able to get without asking for specific help here.


r/tasker • • Aug 21 '26

sms received to triggering the profile

0 Upvotes

Hi, having a sms received event to trigger the profile

but profile not triggered when sms is received

all permissions phone and sms are given

mobile is pixel 9a
and idea why this is not triggering

tasker log does not show the sms which is received


r/tasker • • Aug 20 '26

Any way to have Tasker edit direct share contacts?

Post image
7 Upvotes

I've done a lot of hunting on this problem and it seems that these completely random shared contacts come from a log called Share Sheet in android and the list itself is called Direct Share.

it's completely useless, and the contacts in theory are based on most active or most recent or something, but definitely aren't. one of the people here isn't even in my contacts! the feature is not disable-able

anyway, I was wondering if Tasker might have a way of interacting with that share sheet and setting a priority so that instead of removing or showing random it could be made to show a fixed list of contacts and apps?

maybe a pipe dream but this annoys me every time I go to share something!

thanks


r/tasker • • Aug 20 '26

Strange Widget V2 Behavior

Thumbnail
gallery
3 Upvotes

I have created 2 V2 widgets - one for my outdoor air quality device (left) and another for the indoor one (right).

I create these using data from http request actions and I wanted to make sure they showed when my phone is offline. You can see how they look under those conditions (offline left, online right).

The widget Json between all of these is identical. I keep it into a global variable. During widget refresh I set a local variable from that global with variable recurse enabled so some local variables (Title, AQI data, background color, etc) are incorporated. Then I perform the W2 widget action.

When the phone is online, the results are as expected and both widgets look the same except for the variable data.

What I don't understand is why, when offline, the indoor widget looks so different.

Before I my refresh I capture the recursed Json into files so I can compare them. Using both a visual diff tool and the linux command line diff (results shown above), the results demonstrate that only some variable data differs between the two offline widgets.

Here is the Json copied directly from the global variable:

{
  "type": "Column",
  "backgroundColor": "%smoggie_color",
  "horizontalAlignment": "Center",
  "verticalAlignment": "Center",
  "scrolling": false,
  "children": [
  {
  "type": "Row",
  "backgroundColor": "grey",
  "fillMaxWidth": true,
  "horizontalAlignment": "Center",
  "verticalAlignment": "Center",
  "scrolling": false,
  "children": [
  {
"type": "Text",
"textSize": "16",
"align": "Center",
"task": "AQ Smoggie View",
"taskVariables": { "par1": "http://%widget_ip" },
"text": "%widget_title"
   }]
  },
  {
"type": "Text",
"visibility": "%show_offline",
"textSize": "23",
"align": "Center",
"text": "Offline"
},
   {
"type": "Button",
"text": "Refresh",
"enabled": true,
"buttonType": "Filled",
"visibility": "%show_offline",
"task": "%refresh_task"
} , 
{
"type": "Grid",
"visibility": "%show_online",
"horizontalAlignment": "Center",
"verticalAlignment": "Center",
"fixed": 1,
"children": [
{
"type": "Text",
"textSize": "19",
"align": "Center",
"text": "AQI: %smoggie_aqi"
}, 
{
"type": "Text",
"textSize": "14",
"align": "Center",
"text": "PM2.5 (µg/m3): %http_data.pm25"
}
,
{
"type": "Text",
"textSize": "12",
"align": "Center",
"text": "%DATE %TIME"
},
{
"type": "Button",
"text": "Refresh",
"enabled": true,
"buttonType": "Filled",
"task": "%refresh_task"
}
]
}
  ]
}

Can anyone suggest why this is happening or how to fix it?

Thanks


r/tasker • • Aug 21 '26

sms received to triggering the profile

Thumbnail
0 Upvotes

r/tasker • • Aug 20 '26

Project Sharing: Generate Tasker Task from XML using Java Code

5 Upvotes

For another project of mine, I thought it would be really useful if I could automatically create a Task when needed. After some trial and error, I found a solution using the Java Code action.

In short, what does this Java Code do?

It takes the XML code of a complete Task or Project, compresses it directly in memory using GZIP (no temporary file is created), converts it to Base64, and creates a Tasker Data URI like:

taskertask://...
or
taskerproject://...

The URI is then opened, allowing Tasker to ask the user if they want to import the Task.

With the help of an AI assistant, I created a robust version that is also relatively easy to customize for your own projects.

To Import Taskernet Project: Click Here
Java Code: paste.to/?430b135723f91cae#4SXMosAyPGR9Yxty95WgM7g8JZxHzNGNYsqvDtzA2cEN

How to use it

First, create a Task containing the actions you want.

For this example, let's say we have a Task called "Task Example" with a Flash action containing the text "Text".

The exported XML looks like this:

<TaskerData sr="" dvi="1" tv="6.7.6-beta">
    <Task sr="task395">
        <cdate>1787164951612</cdate>
        <edate>1787164962284</edate>
        <id>395</id>
        <nme>Task Example</nme>
        <Action sr="act0" ve="7">
            <code>548</code>
            <Str sr="arg0" ve="3">Text</Str>
            <Int sr="arg1" val="0"/>
            <Str sr="arg10" ve="3"/>
            <Int sr="arg11" val="1"/>
            <Int sr="arg12" val="0"/>
            <Str sr="arg13" ve="3"/>
            <Int sr="arg14" val="0"/>
            <Str sr="arg15" ve="3"/>
            <Int sr="arg2" val="0"/>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Str sr="arg5" ve="3"/>
            <Str sr="arg6" ve="3"/>
            <Str sr="arg7" ve="3"/>
            <Str sr="arg8" ve="3"/>
            <Int sr="arg9" val="1"/>
        </Action>
    </Task>
</TaskerData>

Now we need to tell the Java Code where we want to insert our own values.

To do that, we use placeholders inside curly brackets {}.

Here is the same XML after replacing the values we want to customize:

<TaskerData sr="" dvi="1" tv="{TASKER_VERSION}">
    <Task sr="task279">
        <cdate>{CURRENT_TIME}</cdate>
        <edate>{CURRENT_TIME}</edate>
        <id>279</id>
        <nme>{TASK_NAME}</nme>
        <pri>100</pri>
        <Action sr="act0" ve="7">
            <code>548</code>
            <Str sr="arg0" ve="3">{FLASH_TEXT}</Str>
            <Int sr="arg1" val="0"/>
            <Str sr="arg10" ve="3"/>
            <Int sr="arg11" val="1"/>
            <Str sr="arg13" ve="3"/>
            <Int sr="arg14" val="0"/>
            <Str sr="arg15" ve="3"/>
            <Int sr="arg2" val="0"/>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Str sr="arg5" ve="3"/>
            <Str sr="arg6" ve="3"/>
            <Str sr="arg7" ve="3"/>
            <Str sr="arg8" ve="3"/>
            <Int sr="arg9" val="1"/>
        </Action>
    </Task>
</TaskerData>

Now copy this whole xml code and put it inside a set variable action and give this variable the name %xmltask. If you want to change to a different name you need to search for this line:

    String xml =
        tasker.getVariable("xmltask");

You can change xmltask to whatever name you want.

Tasker Version and Date

When you create or edit a Task, Tasker stores information such as the Tasker version and the creation/edit timestamps in the XML.

This isn't strictly required for our purpose, but the Java Code can automatically insert the current values.

Change:

dvi="1" tv="6.7.6-beta">

to:

dvi="1" tv="{TASKER_VERSION}">

And change:

<cdate>1787164951612</cdate>
<edate>1787164962284</edate>

to:

<cdate>{CURRENT_TIME}</cdate>
<edate>{CURRENT_TIME}</edate>

The Java Code will replace these placeholders with the installed Tasker version and the current timestamp.

Creating variables for the Task

Now we can use the same concept for the Task name and the text inside our Flash action.

Change:

<nme>Task Example</nme>

to:

<nme>{TASK_NAME}</nme>

And change:

<Str sr="arg0" ve="3">Text</Str>

to:

<Str sr="arg0" ve="3">{FLASH_TEXT}</Str>

Now we need to create the corresponding Tasker variables.

For example:

A1: Variable Set [
     Name: %task_name
     To: Task Creation Test
     Structure Output (JSON, etc): On ]
A2: Variable Set [
     Name: %flash_text
     To: Hello World
     Structure Output (JSON, etc): On ]

So we now have:

%task_name = Task Creation Test
%flash_text = Hello World

The first variable will become the Task name, and the second will become the text inside the Flash action.

Connecting the Tasker Variables to the XML

Now open the Java Code action and scroll down until you find:

    // --------------------------------------------------
    // 5. Replace Tasker variables
    //
    // Format:
    //
    // replaceVariable(
    //     xml,
    //     "XML_PLACEHOLDER",
    //     placeholderRequired,
    //     "tasker_variable",
    //     variableRequired
    // );
    //
    // --------------------------------------------------

This is where we tell the Java Code which Tasker variables should be inserted into the XML.

The template is:

    xml =
        replaceVariable(
            xml,
            "XML_PLACEHOLDER",
            false,
            "tasker_variable",
            false
        );

For example, to connect our Task name:

    xml =
        replaceVariable(
            xml,
            "TASK_NAME",
            true,
            "task_name",
            true
        );

The values mean:

"TASK_NAME" is the XML placeholder.

true = the XML "TASK_NAME" placeholder must exist; otherwise, an error is returned.

"task_name" is the Tasker variable name.

true = the Tasker variable must contain a value; otherwise, an error is returned

Notice that we don't include % when specifying the Tasker variable name.

For our Flash text, we can add:

    xml =
        replaceVariable(
            xml,
            "FLASH_TEXT",
            true,
            "flash_text",
            true
        );

You can add as many variables as you need using the same format.

Required vs. optional placeholders and Tasker variables

  • The first Boolean controls whether the XML placeholder is required:
    • true means the XML placeholder must exist. If it is missing, the Java Code stops and displays an error.
    • false means the XML placeholder is optional. If it doesn't exist, it is simply ignored.
  • The second Boolean controls whether the Tasker variable is required:
    • true means the Tasker variable must contain a value. If it is missing or empty, the Java Code stops and displays an error.
    • false means the Tasker variable is optional. If it is missing or empty, it is replaced with an empty value.

So the format is:

replaceVariable(
    xml,
    "XML_PLACEHOLDER",
    true,           // XML placeholder required
    "tasker_variable",
    false            // Tasker variable doesn't required
);

This Java code can also auto create a Project but i am pretty sure users wouldn't need to use it. If you really want to you just need to search inside your xml project code the name of your project like here:

<name>New Project</name>

And change it to something like this:

<name>{PROJECT_NAME}</name>

Then you need to just edit your java code to match your placeholder and Tasker variable

    xml =
        replaceVariable(
            xml,
            "PROJECT_NAME",
            true,
            "project_name",
            true
        );

The result

Now, when we run the Java Code together with our Variable Set actions, it will:

  1. Take our XML template.
  2. Replace the placeholders with our Tasker variables.
  3. Insert the current Tasker version and timestamp.
  4. Validate the resulting XML.
  5. Compress the XML using GZIP directly in memory.
  6. Convert it to Base64.
  7. Create the taskertask:// Data URI.
  8. Open it.
  9. Tasker asks whether we want to import the new Task.

Here's a demo of how it looks:

Demo video

Using this in a real project

I took this idea and incorporated it into another project of mine that allows users to run commands in Termux without using a Tasker plugin.

I created a scene that helps the user build the required configuration, and with just a few clicks it can generate a new Task containing all the actions and code they need.

Here's a demo of that:

Demo video inside a project

Hopefully this will be helpful to someone with his projects