[Question] %PACTIVE not working - Tasker Tips & Tricks

Hi,
I'm trying to learn Tasker and now I'm playing with active tasks as conditions. But I cannot seem to get %PACTIVE to play nice.
If I print %PACTIVE(#), it displays '0'.
If I print %PACTIVE(), it displays ''
If I try to set %pactive to %PACTIVE, the content is "%PACTIVE", which I've found means it's empty.
But I have one profile active as we speak. It's green in the profiles list and it's also listed in the nofication area.
Any ideas on how to deal with this?

This variable works with "," if you want to do any matching, such as night mode then it will be something like %PACTIVE ~R ,night mode,
Notice that it has to begin with and end with a ,

%PACTIVE is for active profiles, not for currently running tasks. %PACTIVE only lists those profiles for which you have manually set a name by long pressing the profile and then changing the name. If you did not change the name of a profile from its default name, you cannot use %PACTIVE to check whether that profile is active.
%TRUN contains list of currently running tasks.
Use these two as-is. Don't put brackets. Don't put numbers. %PACTIVE and %TRUN are full names of these variables.
%PACTIVE(#) = 0, because there are 0 items in an array of that name. %PACTIVE is a variable, not an array.

@Sukarn and @HatchetEgg
I'm using %PACTIVE to check for currently running profiles that are listed under the Profiles tab. Is that incorrect?
What I tried now, not that I had much hopes for it, is this:
1. If %PACTIVE ~R ,borte, | %PACTIVE ~R ,Borte,
2. If %PACTIVE ~R ,borte,
3. Flash Text Works for borte
4. End If
5. If %PACTIVE ~R ,Borte,
6. Flash Text Works for Borte
7. End If
8. Else
9. Flash Text Nothing to see here! Go away!
10. End If
Click to expand...
Click to collapse
I also tried "*,borte,*", but that didn't work either. "Borte" is only listed as a profile and not a task (the task it runs has a different name).
In every test, the script jumps to the Else part and displays the go away-message. Which I kind of expected as %PACTIVE ~ "\%PACTIVE".

tiwas said:
@Sukarn and @HatchetEgg
I'm using %PACTIVE to check for currently running profiles that are listed under the Profiles tab. Is that incorrect?
What I tried now, not that I had much hopes for it, is this:
I also tried "*,borte,*", but that didn't work either. "Borte" is only listed as a profile and not a task (the task it runs has a different name).
In every test, the script jumps to the Else part and displays the go away-message. Which I kind of expected as %PACTIVE ~ "\%PACTIVE".
Click to expand...
Click to collapse
1. No that is what %PACTIVE should do, to store currently running profiles running in tasker. It might even be case sensitive as well if I remember correctly.
2. The way you setup your task does not look right to me it should be something like this.
1. If %PACTIVE ~R ,borte, | %PACTIVE ~R ,Borte,
2. Flash Text Works for borte
3. Else
4. Flash Text Nothing to see here! Go away!
5. End If
3. From what I can tell from this variable it will not show its content regardless of flash or popup commands, but they do work even if you can't see it's contents. So use the above as an example, so you can implement it into any task.

HatchetEgg said:
2. The way you setup your task does not look right to me it should be something like this.
Click to expand...
Click to collapse
It's basically the same, as far as I can see. You only removed the nested If to tell me if the variable is case sensitive or not. With indentations, my code would be:
1. If %PACTIVE ~R ,borte, | %PACTIVE ~R ,Borte,
2. ... If %PACTIVE ~R ,borte,
3. ... ... Flash Text Works for borte
4. ... End If
5. ... If %PACTIVE ~R ,Borte,
6. ... ... Flash Text Works for Borte
7. ... End If
8. Else
9. ... Flash Text Nothing to see here! Go away!
10. End If
Lines 2 and 5 are just to pick up which one matched - or both, if that's the case. If none of them match, the Else is triggered. Or do you see any other problems?
HatchetEgg said:
3. From what I can tell from this variable it will not show its content regardless of flash or popup commands, but they do work even if you can't see it's contents. So use the above as an example, so you can implement it into any task.
Click to expand...
Click to collapse
Well, it still doesn't enter the first if statement for some reason...

tiwas said:
It's basically the same, as far as I can see. You only removed the nested If to tell me if the variable is case sensitive or not. With indentations, my code would be:
1. If %PACTIVE ~R ,borte, | %PACTIVE ~R ,Borte,
2. ... If %PACTIVE ~R ,borte,
3. ... ... Flash Text Works for borte
4. ... End If
5. ... If %PACTIVE ~R ,Borte,
6. ... ... Flash Text Works for Borte
7. ... End If
8. Else
9. ... Flash Text Nothing to see here! Go away!
10. End If
Lines 2 and 5 are just to pick up which one matched - or both, if that's the case. If none of them match, the Else is triggered. Or do you see any other problems?
Well, it still doesn't enter the first if statement for some reason...
Click to expand...
Click to collapse
Ah ok I understand why you did it that way, Also thanks for pointing this issue out, because by the looks of it, when I checked my profiles that use this global variable, they don't work correctly either! And I had those profiles for about 2-3 years, without any changes.
This would seem to suggest to me that this is a bug that needs to be reported to the dev.
UPDATE
I found out what the problem is! I disabled amplify and now %PACTIVE now works and even reports the actual data now

Related

Minimalistic text widget - local variable depend from week day

I want to make widget that will change it's text depend from week day. I tought it could be done by mixing Minimalistic Text Widget and Tasker but I totally don't know how could anyone help?
Not really sure on the question - Minimalistic Text already displays the weekday.
Do you mean custom text that changes based on the day of the week?
Tasker has a "Day of Week" variable too, so you can switch off of that if that's what you wanted.
I want to display something like this:
"wonderfulWednesday" or "fabolousFriday" and I want to change first part of it (wonderful/fabolous) automatically every day.
anyone?
I don't know how variable text works, but maybe that's the key?
it's right next to static text
A rough way, but working.
Create 7 textfiles
monday,tuesday ..... sunday
In each of them put in the text You want
to be shown according to the given name of file/day
Put files in root of sdcard
In Tasker:
Make a task DayOfWeek
1:Tasker: Variable Set %LINE To 1
2:File: Read Line File:%DAYW Line:%LINE To Var %DAYSTRING
3lugin: Minimalistic Text Variable(Config) DAYSTRING = %DAYSTRING
Make A Profile that trigger Task "DayOfWeek" when ever You want
(Maybe at Time:00:01)
Set a Minimalistic Text Widget on homescreen Showing Variable DAYSTRING
Eurocrypt said:
A rough way, but working.
Create 7 textfiles
monday,tuesday ..... sunday
In each of them put in the text You want
to be shown according to the given name of file/day
Put files in root of sdcard
In Tasker:
Make a task DayOfWeek
1:Tasker: Variable Set %LINE To 1
2:File: Read Line File:%DAYW Line:%LINE To Var %DAYSTRING
3lugin: Minimalistic Text Variable(Config) DAYSTRING = %DAYSTRING
Make A Profile that trigger Task "DayOfWeek" when ever You want
(Maybe at Time:00:01)
Set a Minimalistic Text Widget on homescreen Showing Variable DAYSTRING
Click to expand...
Click to collapse
Hello. I just attempted this profile for another project I'm working on (trying to get Minimalistic Text to show weekdays as numbers- ie: Sunday=1, Monday=2, Saturday=7, etc.) and, although I have the text files in the root of the SD, it says it cannot find the files.
Any ideas?
Bump!
I was trying to find a similar solution as you. I have a Minimalist Text widget that shows the weather forecast for the next two days, and wanted to show the shortened, corresponding days of the week.
paulmz said:
Hello. I just attempted this profile for another project I'm working on (trying to get Minimalistic Text to show weekdays as numbers- ie: Sunday=1, Monday=2, Saturday=7, etc.) and, although I have the text files in the root of the SD, it says it cannot find the files.
Any ideas?
Click to expand...
Click to collapse
The problem you had may have been having a file extension. Tasker would be looking for "Monday" and you've given it "Monday.txt"
I nixed file extensions from my 7 text files, and it works fine.
I'm now trying to figure out how to get the same "mon" output for the day after tomorrow. I tried appending an extra letter to the filename to give "aMonday" withe the text "wed" inside, and I tried putting it on a second line in the "Monday" file. Neither worked. Any ideas?
omgmrj said:
I'm now trying to figure out how to get the same "mon" output for the day after tomorrow. I tried appending an extra letter to the filename to give "aMonday" withe the text "wed" inside, and I tried putting it on a second line in the "Monday" file. Neither worked. Any ideas?
Click to expand...
Click to collapse
For other's sake, I'd like to confirm that the former of my methods works fine. I had mistyped a string in Tasker, which caused my error.
omgmrj said:
For other's sake, I'd like to confirm that the former of my methods works fine. I had mistyped a string in Tasker, which caused my error.
Click to expand...
Click to collapse
Despite this thread being very old, it was a stepping stone for me in getting this to work, and in a way that I think is significantly more efficient.
I was trying to set a Minimalist Text widget to display info in the following format:
TOMSweatherTEMP|TOMNweatherTEMP
TOMS=Day of week tomorrow // For the sake of this example, lets assume today is Monday. We want this to Equal TUE
TOMN=Day of week after that // For the sake of this example, lets assume today is Monday. We want this to Equal WED
My solution
Tasker ProfileayofTom
From: 00:02 - 00:03
Task: DayofTomorrow
Task: DayofTomorrow
Variable Set: %TOMS to %TIMES + 86400 // This sets variable %TOMS to tomorrows date in seconds
Variable Convert: %TOMS Function Seconds to Long Date // This sets variable %TOMS to a long form date
Variable Split: %TOMS Splitter , // This makes the long date split into multiple variables where a "," is present. This creates 3 variables, %TOMS1, %TOMS2, %TOMS3. We will be using %TOMS1, which has become TUESDAY
Variable Section: Name %TOMS1 From 1 Length 3 // Because I wanted to show a short day name (Tues, not Tuesday), this action discards any characters outside of the first 3. Now we just need to send the variable to Minimalist Text
Minimalist Text: Configuration TOMS = %TOMS1 // This action is available through plugins. Set "variable name" to TOMS (this is what is sent to Minimalist Text). Set Variable Content to %TOMS1 (the local variable)
Now go to Minimalist Text and in the widget of your choice and add "Locale Variable" with Variable Name TOMS.
You're DONE!
To get the day after tomorrow:
Create a new profile: "DayofTomNext"
Create a new Task: "DayofTomNext"
Then use the exact same process as above, but add 1728000 instead of 86400, and replace TOMS with TOMN.
Hope this helps any who come around later.
No text files needed

[GUIDE][Difficulty: Beginner] Prompt to add Previous Caller as Contact

Do you find yourself annoyed having to manually add someone as a contact after receiving a phone call from them? Would you rather be prompted with the option to add them as a contact before you fumble going through the proper menus? This short tasker task will do just that for you, using the power of intents.
Prerequisites
OPTIONAL: Snackbar Tasker Plugin to make a neat prompt asking you to add the previous caller as a contact
Instructions
Click + to create a new Profile and name it "Add Contact" or anything else you want.
Choose a "State" context, go to "Phone" and select "Call." Set the Type to "Incoming" and leave the Number field blank.
Back out, and name the task that pops up whatever it is you want.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Here's what your Profile should look like. Now, let's move on to the task itself.
Task --> If. For the first condition, put %CNAME ~ %CNUM. This checks whether or not the previous caller already has a set name by comparing it to the phone number they called from. If the two match, then that means the contact is not recognized. Press the + icon to create another Condition, and make sure that the two Conditions are linked by an And. For the second Condition, set it to %CNUM !~ 0. This checks to see if the previous caller was an unknown/private number, and if so, you won't be prompted to add them as a contact.
OPTIONAL: Plugin --> Snackbar Tasker Plugin. Select a "Bottom Sheet". Enter the configuration for the snackbar, and enter a title for the dialog that will pop-up (I put "Add caller as contact?"). Under "Items to appear in sheet separated by ","" put down Yes,No. Under "Commands to be sent separated by "," enter yes,no. Take note that there should be NO space between the comma. For the color name fields, enter the hex name for however you want the snackbar to be themed. When you're done, exit out by pressing the checkmark, then press the back key when you're back inside Tasker.
System --> Send Intent. Under Action put in android.intent.action.INSERT For Cat, leave it at None. For the Mime Type, type in vnd.android.cursor.dir/raw_contact. Next, for the first Extra field type in phone:[%CNUM] Finally, scroll down to Target and select Activity. If you followed the optional step above to make a snackbar, then under If set the condition to %bs_command ~ yes. This means the intent will only be sent if you select yes when the snackbar pops up after a phone call.
Task --> End If
That's it! Let me know if there are any suggestions you would make.
MishaalRahman said:
Do you find yourself annoyed having to manually add someone as a contact after receiving a phone call from them? Would you rather be prompted with the option to add them as a contact before you fumble going through the proper menus? This short tasker task will do just that for you, using the power of intents.
Prerequisites
OPTIONAL: Snackbar Tasker Plugin to make a neat prompt asking you to add the previous caller as a contact
Instructions
Click + to create a new Profile and name it "Add Contact" or anything else you want.
Choose a "State" context, go to "Phone" and select "Call." Set the Type to "Incoming" and leave the Number field blank.
Back out, and name the task that pops up whatever it is you want.
Here's what your Profile should look like. Now, let's move on to the task itself.
Task --> If. For the first condition, put %CNAME ~ %CNUM. This checks whether or not the previous caller already has a set name by comparing it to the phone number they called from. If the two match, then that means the contact is not recognized. Press the + icon to create another Condition, and make sure that the two Conditions are linked by an And. For the second Condition, set it to %CNUM !~ 0. This checks to see if the previous caller was an unknown/private number, and if so, you won't be prompted to add them as a contact.
OPTIONAL: Plugin --> Snackbar Tasker Plugin. Select a "Bottom Sheet". Enter the configuration for the snackbar, and enter a title for the dialog that will pop-up (I put "Add caller as contact?"). Under "Items to appear in sheet separated by ","" put down Yes,No. Under "Commands to be sent separated by "," enter yes,no. Take note that there should be NO space between the comma. For the color name fields, enter the hex name for however you want the snackbar to be themed. When you're done, exit out by pressing the checkmark, then press the back key when you're back inside Tasker.
System --> Send Intent. Under Action put in android.intent.action.INSERT For Cat, leave it at None. For the Mime Type, type in vnd.android.cursor.dir/raw_contact. Next, for the first Extra field type in phone:[%CNUM] Finally, scroll down to Target and select Activity. If you followed the optional step above to make a snackbar, then under If set the condition to %bs_command ~ yes. This means the intent will only be sent if you select yes when the snackbar pops up after a phone call.
Task --> End If
That's it! Let me know if there are any suggestions you would make.
Click to expand...
Click to collapse
Very nice, except I will never get this typed-in. Maybe publish the script that can be downloaded and inserted from tasker.
Dovidhalevi said:
Very nice, except I will never get this typed-in. Maybe publish the script that can be downloaded and inserted from tasker.
Click to expand...
Click to collapse
I added it as an attachment.
Working great. Thank you.
Good stuff man. I'll test tomorrow.
MishaalRahman said:
I added it as an attachment.
Click to expand...
Click to collapse
I had succeeded in doing this before. However, Tasker does not "see" this in either the projects or autimport folders. To where might I push it?
Dovidhalevi said:
I had succeeded in doing this before. However, Tasker does not "see" this in either the projects or autimport folders. To where might I push it?
Click to expand...
Click to collapse
It's a profile so it should go in the profile folder. To import a profile, you long-press on the "PROFILES" tab up top.
I notice that when I click "Yes" to add the caller as a contact, the phone number comes in the format [##########] with the brackets around it. Is there a way to make it come in the format +1 ###-###-#### ?
Akw6190 said:
I notice that when I click "Yes" to add the caller as a contact, the phone number comes in the format [##########] with the brackets around it. Is there a way to make it come in the format +1 ###-###-#### ?
Click to expand...
Click to collapse
The default intent action requires it to be formatted as such, as anything else simply makes the PHONE field end up as blank (not sure why). However, you can use AutoShare's intent builder with this intent in order to get around this. Credits to redditor /u/YoungKnave for this intent. You download this, import it into AutoShare, then inside Tasker rather than sending an intent through itself you would go to Plugin --> AutoShare and select the intent you imported. Then for the phone number, put %CNUM. I found that doing it this way properly formats it, however I didn't mention it above because AutoShare isn't a free app.
MishaalRahman said:
The default intent action requires it to be formatted as such, as anything else simply makes the PHONE field end up as blank (not sure why). However, you can use AutoShare's intent builder with this intent in order to get around this. Credits to redditor /u/YoungKnave for this intent. You download this, import it into AutoShare, then inside Tasker rather than sending an intent through itself you would go to Plugin --> AutoShare and select the intent you imported. Then for the phone number, put %CNUM. I found that doing it this way properly formats it, however I didn't mention it above because AutoShare isn't a free app.
Click to expand...
Click to collapse
Understood. I'll look into it. Thank you, sir.
MishaalRahman said:
It's a profile so it should go in the profile folder. To import a profile, you long-press on the "PROFILES" tab up top.
Click to expand...
Click to collapse
Found the profiles folder and moved it to there and was able to import it (one thing about tasker are all those non-intuitive, even hidden functions to try out, somehow )
Needs a Bottom Sheet and an AutoShare plugin. What do I install? A lot of plugins with paid additions by one author.
I tried this but I keep getting red marks on the if statement. Is there something I did wrong? Also, I couldnt download the file. How do I download it?
Thanks
Also, when I tried to import the profile, it kept saying failed to import profile data :/
Ok, most stupid question ever. Where do i get the tasker from?
Dovidhalevi said:
Found the profiles folder and moved it to there and was able to import it (one thing about tasker are all those non-intuitive, even hidden functions to try out, somehow )
Needs a Bottom Sheet and an AutoShare plugin. What do I install? A lot of plugins with paid additions by one author.
Click to expand...
Click to collapse
Snackbar Tasker Plugin and AutoShare are completely optional for this profile. The XML I attached uses it because I have paid for it and already use it frequently, but if you follow the instructions I've written above then you do not need to use either.
It might seem odd, but once you get into Tasker you will notice a recurring name in the most frequently recommended plugins: joaomgcd. This guy is a wizard at Tasker, and has made dozens of Tasker plugins. While you CAN do things without his plugins (as I've written) it does make things neater and simpler. It's up to you though.
arbolarc said:
I tried this but I keep getting red marks on the if statement. Is there something I did wrong? Also, I couldnt download the file. How do I download it?
Thanks
Click to expand...
Click to collapse
The red marks are fine. They simply mean that RIGHT NOW if you were to run the task it would fail the If statement. Meaning, the last phone call you had was from a recognized phone number, hence Tasker would fail this condition since it should only fire when the previous caller is not a recognized contact.
C114 said:
Ok, most stupid question ever. Where do i get the tasker from?
Click to expand...
Click to collapse
There are no stupid questions here! Here you go.
MishaalRahman said:
Snackbar Tasker Plugin and AutoShare are completely optional for this profile. The XML I attached uses it because I have paid for it and already use it frequently, but if you follow the instructions I've written above then you do not need to use either.
Click to expand...
Click to collapse
I installed them, not yet paid up. However, if I can get along without them, I already have a pretty crowded phone so a couple less apps would not hurt.
As I said, the problem is hand-entering all this stuff. Please attach a "virgin" version as well. Folks could try them both, see if they prefer snackbar's eye-candy or going bare is good enough. Unless I intend very involved usage, AutoShare might be overkill.
Not sure what I am missing, but the Send Intent action never fires for me, as the IF statement never passes.
I added a Flash action to verify that the %bs_command variable is being set correctly, and it appears to be.
Any ideas?
EDIT: Scratch that.. looks like my phone autocorrected one of the commands in the Send Intent action. Working now!
Nevernind i found the way

Open app profile without Tasker accessibility services

Hello!
I have a question about profile to execute task when opening or closing app without accessibility services turned on.
So I want my phone to automatically do some stuff when I open a particular app.
Is is possible to detect app open or close without enabling Tasker accessibility sercice.
Why I want this? I have Nexus 5x rooted with TWRP, so I want encryption enhanced with my password, which is not possible when one have any accessibility service enbled.
So, is there a way to detect app opening or closing without tasker accessibility service?
Thank you!
How experienced are you? You can use this as a guide, but since oom_adj values behave differently for other devices, you'll need to take the concept and modify it to your needs...but yes, you can create your own looping task to detect the launch or closing of any app. Here's how I detect that Tasker has closed:
Code:
Detect Tasker (355)
Run Both Together
A1: Variable Set [ Name:%newline To:
Do Maths:eek:ff Append:eek:ff ]
A2: Variable Set [ Name:%space To: Do Maths:eek:ff Append:eek:ff ]
A3: Run Shell [ Command:ps Timeout (Seconds):0 Use Root:eek:ff Store Output In:%apps Store Errors In: Store Result In: ]
A4: Variable Split [ Name:%apps Splitter:net.dinglisch.android.taskerm Delete Base:eek:ff ]
A5: Variable Split [ Name:%apps1 Splitter:%newline Delete Base:eek:ff ]
A6: Variable Set [ Name:%last To:%apps1(#) Do Maths:eek:ff Append:eek:ff ]
A7: Variable Set [ Name:%taskerpidline To:%apps1(%last) Do Maths:eek:ff Append:eek:ff ]
A8: Variable Split [ Name:%taskerpidline Splitter:%space Delete Base:eek:ff ]
A9: Variable Set [ Name:%taskerpid To:%taskerpidline4 Do Maths:eek:ff Append:eek:ff ]
A10: Run Shell [ Command:cat /proc/%taskerpid/oom_adj Timeout (Seconds):0 Use Root:eek:ff Store Output In:%oom Store Errors In: Store Result In:%Aresult ]
A11: Flash [ Text:%oom Long:eek:ff ]
A12: Wait [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ]
A13: Goto [ Type:Action Number Number:1 Label: ] If [ %oom < 2 ]
A14: Write File [ File:DetectTasker/shutdownlog.txt Text:%DATE %TIME Append:eek:n Add Newline:eek:n ]
You'll need to change A4 to the package name you want and insert a flash of %oom in the loop so you can understand how the value behaves for you when opening and closing the app...then change the check on A13 to what works for you. A14 writes a file, so you could use a File Modified context to trigger whatever tasks you want.
Sent from my SM-G928C using Tapatalk
Well, to be honest, I am not that experienced, and this is a bit too much for me.
Specifically I want to automatically execute some tasks when opening and closing Nexus 5x Camera app (stop music playing when opening and opening Snapseed when closing and other). I know that this is not very serious life dependant stuff, but Tasker is all about making life easier ?. Tasks are easy to create, but I am not knowledgeable enough to understand everything you proposed.
Thank you for your effort anyway!
deleted
kurci2 said:
Well, to be honest, I am not that experienced, and this is a bit too much for me.
Click to expand...
Click to collapse
No worries. One of the beautiful things about Tasker is that there's almost always multiple ways to achieve your intended result.
kurci2 said:
Specifically I want to automatically execute some tasks when opening and closing Nexus 5x Camera app (stop music playing when opening and opening Snapseed when closing and other).
Click to expand...
Click to collapse
If you really want this and feel overwhelmed by the shell scripts above, you can probably avoid trying to detect the camera app altogether by making a shortcut out of your task and using it to launch the camera instead of the app icon. Set an icon and save a shortcut to your desktop or whatever that turns off the music and launches the camera. Always use that shortcut icon to open your camera app instead of the camera app's icon.
You could do a variety of things to avoid detecting when the camera closes. You could make a task that runs the tasks you wish to perform when camera closes, then kills the camera itself... And you could display an invisible overlay scene that performs that task when you long press it....or you could use Xposed Additions module to map that task to the Back and Home buttons... Lots of options there.
kurci2 said:
I know that this is not very serious life dependant stuff, but Tasker is all about making life easier ?. Tasks are easy to create, but I am not knowledgeable enough to understand everything you proposed.
Thank you for your effort anyway!
Click to expand...
Click to collapse
Overcoming these kinds of challenges is what helps you master Tasker. [emoji2]
Sent from my SM-G928C using Tapatalk
RuggedHunter said:
Overcoming these kinds of challenges is what helps you master Tasker. [emoji2]
Click to expand...
Click to collapse
Hello again!
I have started to learn tasker, but I am only at basics. For example I configured WiFi ON/OFF based on cell towers around me and I automated SMS backup.
But I am still far away from understanding your script (for example I do not know what to write in "To:" section and I do not know that does ff mean).
Before I had multiple wishes for tasker to do. I wanted it to automatically make all the pictures black and white when would enable that profile, but I found other quick ways with Snapseed and photoshop. After that I wanted automatic photo uploading and then I figured that Google Photos is the greatest of them all and already automatic. Etc.
There is only one thing left that I can not solve without this tasker script. I want to turn off camera sounds. I know about deleting camera sounds in system folder, but if one uses HDR that is not effective, because HDR makes its own sound. Those camera sounds are really annoying to me.
So I am asking you if you can help me to create a tasker profile and task to enable Do not disturb mode when camera app is opened and restore to previous volume setting when camera is closed. I use stock Google Camera on Nexus 5X, and I think this is the best and most straight forward android camera app.
So my question is if you can help me to configure this profile. This is kind of my last thing from Nexus perfetion .
[SOLVED] - Accessibility services and password enhanced encryption
Hello!
I have managed to solve my problem and I want to share it with everyone else who (like myself) does not know this workaround.
Issue description.
So as I mentioned, I have a rooted Nexus 5X with TWRP recovery (like many other here I am sure). As we know, to protect my data form beeing accessible directly via TWRP one must have "Password enhanced encryption". But the problem is, that when one enables any of the Accessibility Services the message pops uot, that the following action will disable "Password enahnced encryption" - unacceplteble security issue for some.
Solutin.
It turn outm that you can easily re-enable "Password during boot" option in security.
Steps:
Settings --> Accessibility --> Enable any of the services you want (Tasker in my case).
You will get the message stating: "If you turn on Tasker, your device won't use your screen lock to enhance data encryption."
For now you just click OK and procede. Note, that your device encryption is now not password enhanced.
It turns out, that one can just re-enable password protected encryption back in security settings.
Settings --> Security --> Screen Lock --> Chosse which one you perfer --> Enable "Reqire password to start device" and voila
You will see a message saying that the service won't be accessible till the device fully boots, but after that everything runs perfectly.
So, that's it.
It turns out, that I actually do not need all these comlicated Tasker scripts after all.
I would like to thank everyone for help. (Reddit source: https://www.reddit.com/r/Android/comments/3vry8k/users_running_lollipop_or_newer_may_be_using_a/)
Hi, I tried Tasker on encrypted device and now I uninstalled Tasker, reboot and TWRP + boot don´t wont PIN. It seems like device is not encrypted now. But in settings - security is "encrypted". How can I fix it? Thanks
---------- Post added at 11:26 AM ---------- Previous post was at 11:17 AM ----------
I can´t find "Password during boot" option. I have Pure Nexus (7.1.1_r21). Now I uninstall Tasker, reboot but TWRP / Boot don´t requite PIN. Settings - security says encrypted. How can I fix it please?

[Guide][OOS][Root][Tasker] Disable visual annoyances during night

Hello guys, i'm no tasker expert, but i'll try to share my setup in order to turn off automatically notification (pulse) led, charging led and new notification wake up screen (under ambiant display) using tasker.
Requirements:
OOS (most custom roms have these things natively, and commands may differ from rom to rom)
Root
tasker
If you're new to tasker and need more step by step guide to create a task, there are plenty of tutorials and videos for that :good:.
First thing to understand is that there are multiple commands, you can choose to merge all the ones to disable lights into one task, and all the ones to enable lights back into another task, that's the easier way, but you can choose to make individual tasks that will be called one by one in another "main task", that's up to you, but the second choice will ask some extra work.
All the tasks will be created the same way, so i'll just help you with the first, then simply redo the things with the other commands.
Let's start with charging led, I named it LightsOff but you can name any task like you want.
Go to thet tasks tab, hit the "+" in the lower right, then name your task (LightsOff ?), then hit again the "+", type shell in the search field and select the "run shell", then, you'll need to type the different commands to be ran, one by line, so it meens after each command, hit "enter"
Once you're done, don't forget to tick the root checkbox.
For example, to turn the charging led Off you'll need the following commands:
Code:
settings put system battery_light_full_color 00
settings put system battery_light_medium_color 00
settings put system battery_light_low_color 00
There are other commands to turn it off, but for some reason, turn it back on will require a reboot, so to avoid that, i simply changed the colors to black, so it's not really turned off, but black (which is, for us, exactly the same).
You'll find all the commands at the end of the post, if you want to merge all commands (recommanded) into one task, go there and just add them to the task before saving it.
Save the task.
Now let's make the task that will get your charging led back to normal (or whatever suits you).
It's almost a copy and paste as the only changes are the name of the task (LightsOn ?) and the values for the colors.
Commands to type:
Code:
settings put system battery_light_full_color 16711936
settings put system battery_light_medium_color 16842752
settings put system battery_light_low_color 16842752
Save the task (root ticked obviously).
These are the default values, you can try other values if you like, that's what i've done, i like dimmed lights for charging, so mines are
Code:
settings put system battery_light_full_color 4096
settings put system battery_light_medium_color 8126464
settings put system battery_light_low_color 8126464
Before you ask, i could not find how find the correct number for a wanted color, i just tried many and wrote down ones i could keep, if you have an idea let's share it
So, now, here are the other commands that you can choose to merge to the first task or just create more tasks for each.
Wake up screen on new notification (you can find it under the ambiant display menu)
Warning: not same command as before, this setting is stored in the secure settings, not the system settings
Disable:
Code:
settings put secure notification_wake_enabled 0
Enable:
Code:
settings put secure notification_wake_enabled 1
And for the pulsing notification light.
Disable:
Code:
settings put system notification_light_pulse 0
Enable:
Code:
settings put system notification_light_pulse 1
You can merge all the commands in one single task for enable and another for disable if you want, that will be easier to setup.
Now all you have to do is create a new profile for night based on time of the day that will trigger the lights off.
Go to profiles tab, hit the "+" then "time" and choose the hours that suits you.
then select the task you want to run (the one that will turn off everything), after that, long click on the selected tak and select "add exit task"
then select the task that will turn all back on.
If you merged all the commands you're done, if not, you'll need to crete two tasks that will group the different tasks you want, i don't thinks it's worth the extra work but for knowledge purpose here's what you have to do.
Go to Tasks Tab, hit "+", give a name, hit "+" type "perform" in the search field and then select "perform task", hit the magnifying glass (the search icon, sorry english isn't my native language) then select the task you want, repeat this for each task you want to add to the "main" task.
Do the same for the "exiting" task.
This way is better as you can add extra tasks like going to airplane mode or mute sounds or whatever you want, but i i told before, it's much more work.
Hope this will help some stock (or xXx :good users, if you have questions, i'll try to answer, but as i said earlier, i'm really no expert with tasker, but if i could manage to do it, you too !
Have a nice day XDA !

Profile triggered by %time variable not firing

Phone is Pixel 3a running Android 10, Tasker is up-to-date.
I have a profile called PwrConnect that runs a task called Clock. The task simply launches my alarm clock app on the phone. The profile is primarily triggered when any power is connected to the phone but it has a secondary condition that specifies the time must be between 10:30pm and 6:00am.
When I plug my charger into the phone the profile is not triggered. If I remove the secondary condition (the time constraint) then the profile triggers when I plug in. But here's where it gets kind of strange. If I include the secondary condition (the time constraint) and I have the Tasker app open when I plug the charger in then the profile fires and runs the task which launches the clock app. Alternatively, I have also tried putting the time constraint in the task (%time > 2230) but that does not work either.
What am I doing wrong??? Or, is this a bug? Anyone else see anything like this?
Do you have "reliable alarms" enabled?
Have you tried a simple profile to just test the time context?
ktmom said:
Do you have "reliable alarms" enabled?
Have you tried a simple profile to just test the time context?
Click to expand...
Click to collapse
I'm not sure what "reliable alarms" is. Is that a setting in Tasker or Android?
Anyway, I have done some more testing. I added another step to the Clock task to simply flash a message when the task runs and I have found that the task (and therefore the profile) is indeed being executed as it should be - that is: when power is connected and the time is between 10:30pm and 6:00am. I can tell this because the message flashes on the screen when I connect power. BUT... the clock app only launches if I have the Tasker app open when I connect power. If the Tasker app is not open then I see the message flash but the clock app does not launch.
Reliable alarms is a tasker setting in preferences on the monitor tab. It helps tasker accurately execute time related activities.
What device and ROM are you on?
The following profile works fine for me with Tasker not in the foreground:
Code:
Time: From 11:44AM Till 3:44PM
State: Power [
Source:Any
]
Enter: Open App
A1: Launch App [
App:Clock
Data:
Exclude From Recent Apps: Off
Always Start New Copy: Off
]
ktmom said:
Reliable alarms is a tasker setting in preferences on the monitor tab. It helps tasker accurately execute time related activities.
What device and ROM are you on?
Click to expand...
Click to collapse
Device: Pixel 3a, ROM: stock Android 10 (not rooted)
I am fairly certain that the problem lies with the clock app that I am using. When I change the task so that it launches the stock, built-in clock app then everything works as it should. The clock app that I am trying to use (Kaloer Clock) is no longer in the PlayStore so has not been updated in a while. So, I suspect that there is something about it that Android 10 does not like. The app still functions fine and I can manually start it or Tasker will start it IF Tasker is running in the foreground. In fact this app has a setting that should start it automatically when power is plugged in but that stopped working about the time that I upgraded to Android 10, which is why I was trying to automate it with Tasker. I hate to give up on this app though because it is the only clock app I have found that allows me to tap anywhere on the screen to snooze the alarm (or long-press to cancel it). Everything else I have tried makes you tap an on-screen button which is difficult without my glasses.
Using AutoNotification (or any tasker notification listener plugin), a scene and intents, you can make the Google Clock have a full screen snooze/dismiss "button".
I slapped together an example that I put on Taskernet. It's full screen, a tap snoozes and long press dismisses.
To run it as is, you will need AutoNotification installed. The "ktm" after the profile/task/scene names can be removed. I do this to help prevent name collisions with anything already existing during import.
ktmom said:
Using AutoNotification (or any tasker notification listener plugin), a scene and intents, you can make the Google Clock have a full screen snooze/dismiss "button".
I slapped together an example that I put on Taskernet. It's full screen, a tap snoozes and long press dismisses.
To run it as is, you will need AutoNotification installed. The "ktm" after the profile/task/scene names can be removed. I do this to help prevent name collisions with anything already existing during import.
Click to expand...
Click to collapse
Ktmom,
I installed AutoNotification and imported your project. I am assuming that I need to delete either step 2 or 3 in the Stop Alarm ktm task. But, the scene does not appear unless I have Tasker running in the foreground when the alarm fires. Just wondered if you have test this in Android 10? Seems as though all my problems started after I upgraded.
dremelts said:
Ktmom,
I installed AutoNotification and imported your project. I am assuming that I need to delete either step 2 or 3 in the Stop Alarm ktm task. But, the scene does not appear unless I have Tasker running in the foreground when the alarm fires. Just wondered if you have test this in Android 10? Seems as though all my problems started after I upgraded.
Click to expand...
Click to collapse
The action that you're not using can be deleted or left paused.
And no, sorry, I'm always slow to update to major releases. But, there's something to try.
Edit the scene that your using, without changing anything else, tap the 3-dot menu. Select "properties" and change the "property type" to "activity". Save out of the scene.
Now edit the task -> show scene action that you are using and change "display as" to "activity".
Save out of the task, and Tasker, then test again.

Categories

Resources