Automating Day / Night Theme in Reddit Sync using AutoInput
EDIT: The developer of Reddit Sync has now implemented an auto day / night theme feature. I will leave this guide up in case it helps anyone learn the basics of AutoInput, just know there is a much easier autotheming option now!
Newly released tasker plugin AutoInput (http://joaoapps.com/autoinput) allows you to automate your apps in mind-blowingly complex and interesting ways. In this post I will focus on a simple use-case that takes advantage of the app's ability to emulate screen touches.
I was eager to put this plugin to use, so I thought of one “nice to have” profile that would solve a frustration I've had with my favorite Reddit app, Reddit Sync. Reddit Sync is great for doing everything Reddit, and it even has the option to switch between day and night themes. My only gripe about this (first world problems, I know) was that there was no native support for scheduling the theme to be switched between Night and Day mode.
I'll preface this by saying there are a thousand ways you can set up the day / night trigger so let your imagination run wild. My solution isn't the most elegant but it works. It's just one example that is meant to give you an idea of how you can automate switching themes for Reddit Sync. Your designated night / day usage are obviously going to differ from mine so you'll want to change those if you decide to use the same trigger configuration.
You can grab the XML to import this profile into Tasker here: https://docs.google.com/document/d/1CbdA2PCF8_HCjNYus-Pwy5Njne4RaoJuhQURZ4D8P3s/edit?usp=sharing
Warning: Tasker jargon ahead. If you aren't familiar with Tasker this guide may not be all that helpful.
Here is the list of profiles I use to accomplish the theme automation:
The Reddit Sync Theme Task you see above is a profile that is triggered when Reddit Sync is launched. But we don’t want this theme control to happen every single time you open the profile, so we’re going to create a switch mechanism that will turn this profile on, run the AutoInput task, then turn itself off. This will happen two times throughout the day, during the day and at night. Obviously, my day switch is 6:30 AM and my night switch is 12:30 AM, so I’m telling Reddit Sync that the first time it should run after those times have passed it should run my Auto Input profile once and then turn itself off. So the purpose of the two profiles below is simply to switch a variable value to 1, which tells the variable value profile to turn on the Reddit Sync Task profile and have it run with Reddit Sync is open. Below are the tasks contained in my AutoInput task, triggered as a result of the Reddit Sync Task profile (opening Reddit Sync):
This should give you a good idea of how this Profile is self terminating and makes for a clean switch mechanism when combined with the day / night profiles. So how do you get the AutoInput parts of this task setup? Luckily, the developer of AutoInput made this very easy for us. When you go to setup your task, find the Plugin section. I used the ‘AutoInput Action’ for all 4 AutoInputs.
When you select AutoInput action, you’ll have a few choices as seen below:
Here we want ‘Easy Setup’ this will prompt a notification in the notification shade with instructions telling you to select your app, press ‘Add’ in the notification shade, and then select the element within your App you want to be selected by AutoInput.
Were going to utilize this Selecting Field capability for the touch automation. Open Reddit Sync and select ‘Front Page’. This tells AutoInput that the Front Page element is the element you want to interact with. Once selected, the notification message will change and let you view the details of the element you selected. What you want to do is hit ‘Accept’ at the bottom of the notification. You are then prompted to navigate back to Tasker in the recent items menu, so pull up Tasker and fill in the rest of the Configuration details. All you need is the Type set to Text, Value set to frontpage, and the Action set to Click. Below is a reference for what the completed Action list will look like.
Rinse and repeat this step to get your other Actions. So you will make an Action to click Settings after the Frontpage, then click the Night Mode. From there you can hit Settings at the top left to navigate back to the Frontpage. To get an idea for the Values I used reference the Task Edit screenshot I posted earlier.
This is the first android guide I've written, please let me know if you have and questions or feedback.









