Send intent to spotify to open "Add to Playlist" screen - Tasker Tips & Tricks

Happy Sunday Folks,
How are ye keeping on this fine day?
My intent is to open the "Add to playlist" screen for the currently playing track on the android spotify app directly by sending an intent to Spotify through tasker (screen cap attached of "Add to Playlist" screen. From messing around with catlog, I have found an intent in the spotify sdk that unfortunately is not working in it's current iteration.
A1: Launch App [ App:Spotify Data: Exclude From Recent Appsff Always Start New Copyff ]
A2: AutoSpotify Player State [ Configuration:Warning: To receive media events from the Spotify app you need to set Device Broadcast Status to ON in the Spotify app’s settings. Package:com.joaomgcd.autospotify Name:AutoSpotify Player State Timeout (Seconds):20 ]
A3: Send Intent [ Action:com.spotify.music/com.spotify.mobile.android.spotlets.playlist.activity.AddToPlaylistActivity Cat:None Mime Type: Data:spotify:track:%astrackuri Extra: Extra: Extra: Package: Class: Target:Activity ]
May I kindly ask if ye could help me with this?

I was fighting to do the same thing with AddToPlaylist. I use Pandora but make playlists for a friend who uses Spotify, of what I'm listening to. Unfortunately I was able to get the AddToPlaylist intent run but nothing was added. Best I was able to pull off was use AutoInput to automate it for me. I've attached an export if you'd like to take a look and see if it can be adapted to what you want to accomplish.
Pulls title and artist from Pandora notification and sets to variable
Strips "()" and any text between them from variable(Spotify has issues finding songs for me)
Opens Spotify and searches for the variable
Long clicks on the first SONG result
Clicks add to playlist
Clicks first playlist
Clears search
Goes home
It can probably be cleaned up/improved but it works for what I need it to do.
Requires:
AutoInput plugin
Notification Listener plugin
KC Tasker Processes plugin

Related

Sending an intent to tasker, from tasker

I'm trying to follow this how-to: Dynamic Home Button Behavior (GrogBase), but I am having problems sending and receiving an intent. Can anybody tell me how to format the intent to be sent by a task, to be received by tasker?
1. Just create a task with a "send intent" action and fill in the first field (action): TEST_ACTION
2. Now Create a profile (Event, Intent received) and again, fill in the first field (action): TEST_ACTION
Then add a popup or vibration or something as a task to see whether it will work.
Now go back to the task from 1. and run it.
This should work.
(Credit goes to @ascsa who explained it to me here)

How to Play/Pause a Video

Hi!
..trying since days something I want to build...
What I want:
I want to use an old Tablet as a Digital VideoFrame..
..when the Tablet starts a Video should play (with GoogleVideo Player) and after 10 seconds it should Pause..
..and when motion is detected the Video should toogle to Play and after 10 Seconds Pause..and so on...
With the App "Motion Detector" I am able to start the Video...but I am not able to Pause the Video..has anyone
an idea how to do this?
thx
7.even
I'd do something like this:
Profile: Shake For Video (16)
Event: Shake [ Axis:Up-Down Sensitivity:Medium Duration:Medium ]
Enter: Anon (23)
A1: Open File [ File:xxxx.mp4 Mime Type:video/* ]
A2: Wait [ MS:0 Seconds:10 Minutes:0 Hours:0 Days:0 ]
A3: Media Control [ Cmdause Simulate Media Buttonff App: ]
The profile is triggered by an event > sensor > then choose how you want to trigger
Action 1 opens a video file
Action 2 waits 10 seconds
Action 3 Media > media control > pause
You could blend the use of Motion Detector by trigger the tasker task on the launch of Motion Detector and execute the pause command after 10 seconds.
..thanks for the answer...I did it that way but the VideoPlayer doesnt Pause or Stop or anything...
7.even said:
..thanks for the answer...I did it that way but the VideoPlayer doesnt Pause or Stop or anything...
Click to expand...
Click to collapse
Works for me, I tested before posting.

Just can't get some simple tasks to work

Ok. I've re-installed Tasker after a year or so and set up a few simple profiles, but I can't get a couple of very simple tasks to work.
1. Keep screen on for specific apps:
Profile > Launch App > iPlayer, Youtube or Ghostery Browser
Task > Display Timeout > 23 Hrs
Exit Task > Display Timeout > 30 secs.
Launch the apps, but screen off after 30 secs. (I've tried deleting the Exit Task, makes no difference).
2. GPS on
Profile > Launch App > Maps
Task > Location > GPS > On
Exit Task > Location > GPS > Off
GPS stays off.
Other tasks seem ok (Auto rotate for certain apps, Silent at night, etc).
I've got an LG G3 (D855), running 5.0 and rooted. I've given Tasker admin privileges and installed Autotools.
Any ideas?
Better if you post the DESCRIPTION of the profile instead of describing it.
Long press on the profile name -> 3-dot menu -> export -> export "DESCRIPTION" to clipboard (not XML). Then paste here.
Beginner mode must be off and the profile must be named. If you didn't name it, there will be a default name created from the first context. You need to actually name the profile by long pressing and tapping the "A" at the top.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Thanks ktmom,
Ok here it is:
Profile: Screen On (20)
Application: BBC iPlayer or Ghostery
Enter: Screen On (21)
A1: Display Timeout [ Secs:0 Mins:0 Hours:23 ]
You edited the context and added "or Ghostery", right? If, not, how did you create the OR between two apps?
Add a flash alert action at the *end* of the Screen On task. Set the text to "Screen on %DTOUT". The flash alert should return "Screen on 82800" for a 23 hour timeout.
What device, ROM?
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Thanks ktmom,
No, that's just from export. Just did it again to check, it says 'Application: BBC iPlayer or Ghostery'
I'll try that. Not sure how to add a flash alert action. Is it a Variable?
From my OP: "I've got an LG G3 (D855), running 5.0 and rooted. I've given Tasker admin privileges and installed Autotools. "
Thanks for your help.
Munky99 said:
Thanks ktmom,
No, that's just from export. Just did it again to check, it says 'Application: BBC iPlayer or Ghostery'
I'll try that. Not sure how to add a flash alert action. Is it a Variable?
From my OP: "I've got an LG G3 (D855), running 5.0 and rooted. I've given Tasker admin privileges and installed Autotools. "
Thanks for your help.
Click to expand...
Click to collapse
A flash action is contained under the alerts. Your can filter in the action list, just type in "flash".
Sorry, I overlooked the device in the OP. I think the LG phones have a problem setting the display time out. Try setting it to a standard number your device recognizes, such as 10 or 15 minutes.
If that works, but not the 23 hours your trying, then there may be a way to get around the problem using a script (requires root).
Edit:
Here is an example of using code -> Run Shell with root to shame the display timeout at a system level. This may or may not work on your OS.
Profile: Screen On
Application: <whatever app(s) should trigger profile>
Enter: Screen On
A1: Run Shell [
Command:settings get system screen_off_timeout
Timeout (Seconds): 0
Use Root: On
Store Output In:%DisplayTimeOut
Store Errors In:
Store Result In:
]
A2: Run Shell [
Command:settings put system screen_off_timeout 6000000
Timeout (Seconds): 0
Use Root: On
Store Output In:%DisplayTimeOut2
Store Errors In:
Store Result In:
]
A3: Flash [
Text:Screen on %DTOUT
DisplayTimeOut %DisplayTimeOut
Long: On
]
Exit: Screen Off
A1: Run Shell [
Command:settings put system screen_off_timeout %DisplayTimeOut
Timeout (Seconds): 0
Use Root: On
Store Output In:%DisplayTimeOut2
Store Errors In:
Store Result In:
]
A2: Flash [
Text:Screen on %DTOUT
DisplayTimeOut %DisplayTimeOut
Long: On
]
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers

trigger alarm with a notification

I'm trying to get an alarm to go off when my calendar notifies me of an event. I can get the alarm to trigger but not switch it off. The only way I can kill the alarm is by forcing tasker to stop. Is there some way you can't kill the alarm or is this a bug as mentioned in the tip tool (Samsung galaxy Tab S3)
Understanding how your task is setup would be useful. Please look for the pinned post in this forum is you need help exporting the description of the task.
Alarm (5)
A1: Alarm Volume [ Level:11 Display: off Sound: off ]
A2: Play Ringtone [ Type:Alarm Sound: Stream:4 ]
A3: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]
A4: Cancel Alarm [ Mode: Disable Current Hours:0 Minutes:0 Label: ]
The two last steps in the profile is my attempt to stop the alarm as I can't switch it off when it triggers
I'm not aware of any way to stop a play ringtone action. The problem had to do with underlying android and the need to reference the original play ringtone instance.
Most people use music play instead with a music stop action.
The cancel alarm action is for system alarms, which you can set through tasker, but you would need to use an alarm set action.
When you choose a stream in a audio action (such as the alarm in your play ringtone), you're determining which volume control affects the sound. It's not the same as creating a system alarm.
ktmom said:
I'm not aware of any way to stop a play ringtone action. The problem had to do with underlying android and the need to reference the original play ringtone instance.
Most people use music play instead with a music stop action.
The cancel alarm action is for system alarms, which you can set through tasker, but you would need to use an alarm set action.
When you choose a stream in a audio action (such as the alarm in your play ringtone), you're determining which volume control affects the sound. It's not the same as creating a system alarm.
Click to expand...
Click to collapse
Thanks that seems to have done the trick.

intervelometer

I wish to be able to take multiple photos with touching the phone or talking to it or smiling at it I want it to take photos after setting it, until I stop it
Can tasker be my answer and do this somehow?
Would be great if someone could assist me with this
Thanks in advance
You can create a task that takes a picture, waits however long you want them loops back using a "go to" action to take a picture again. Putting an if statement to check a variable (maybe "takePhoto") in the "go to" action and execute the "go to" only if the "takePhoto" variable is true.
I would have a profile that calls this task if that "takePhoto" variable is true.
To start the process of taking pictures, use a Tasker shortcut/widget to call a task that sets the "takePhoto" variable to true. The next time that Tasker shortcut/widget is run, clear the "takePhoto" variable which will stop the task that is actually taking photos. You can toggle the "takePhoto" variable using logic like:
A1: If [ %takePhoto ~ true ]
A2: Variable Clear [
Name:%takePhoto
Pattern Matching: Off
Local Variables Only: Off
A3: Else
A4: Variable Set [
Name:%takePhoto
To: true
Recurse Variables: Off
Do Maths: Off
Append: Off
Max Rounding Digits:0
A5: End If
Duolicated
ktmom said:
You can create a task that takes a picture, waits however long you want them loops back using a "go to" action to take a picture again. Putting an if statement to check a variable (maybe "takePhoto") in the "go to" action and execute the "go to" only if the "takePhoto" variable is true.
I would have a profile that calls this task if that "takePhoto" variable is true.
To start the process of taking pictures, use a Tasker shortcut/widget to call a task that sets the "takePhoto" variable to true. The next time that Tasker shortcut/widget is run, clear the "takePhoto" variable which will stop the task that is actually taking photos. You can toggle the "takePhoto" variable using logic like:
A1: If [ %takePhoto ~ true ]
A2: Variable Clear [
Name:%takePhoto
Pattern Matching: Off
Local Variables Only: Off
A3: Else
A4: Variable Set [
Name:%takePhoto
To: true
Recurse Variables: Off
Do Maths: Off
Append: Off
Max Rounding Digits:0
A5: End If
Click to expand...
Click to collapse
sorry but istruggling to get the hang of this, is there a way you can create the profile and I can load it to my tasker?
I could, but I'm not interested in writing other people's tasks for them [emoji846]. There are apps in the play store that won't require Tasker.
If you post your current attempt (see the sticky post in this forum for help with that), I'd be happy to help you troubleshoot or tweak.

Categories

Resources