[Android Apps and Games] gloscherrybomb:
OK, so here is how I have done it!

I have 3 different tasker tasks:

1: Search Spotify (Can be anything, e.g. "The Killers Mr Brightside")

2. Search Spotify Artist: Search for a specific artist (The same as the search task, the search term comes after "artist:" e.g. "artist: Oasis"

3, Play Spotify starred playlist (Opens the starred playlist and begins playing a song (I have shuffle on as default))

The Utter! set up is easy: Custom command, run tasker task. If it works, say “What would you like to search for on Spotify”

The tasker set up is as follows:

Spotify Search Task:

1.	Kill App (App: Spotify || Use Root: On) N.B. This is because I have had problems running the task when Spotify is already running, but the kill command does not seem to always work, so this bit needs to be improved.

2.	Wait (Seconds: 5) N.B. this is to allow tasker to finish its audio output and processing before asking for your search term.

3.	Get Voice (Title: Spotify Search || Timeout: Seconds: 30) N.B. This allows you to speak the search term,It is stored in a variable called %VOICE.

4.	Send Intent (Action: android.media.action.MEDIA_PLAY_FROM_SEARCH || Extra: Query: %VOICE || Package: com.spotify.mobile.android.ui || Class: com.spotify.mobile.android.ui.Launcher || Target: Activity)

5.	Wait (Seconds: 10) N.B. This is to allow spotify to full launch and begin playing the media before switching to the now playing view.

6.	Send Intent (Action: com.spotify.mobile.android.ui.action.player.SHOW || Package: com.spotify.mobile.android.ui || Class: com.spotify.mobile.android.ui.activity.MainActivity || Target: Activity) N.B. This switches the display to the now playing screen. You may not want this bit I prefer it for in car use.

The artist search task is the same but in the first intent, the Extra is set as: “query: artist:%VOICE”

The starred playlist is a little different:

1.	Kill App

2.	Send Intent (Action: android.intent.action.VIEW || Data: spotify:user:”username”:starred || Package: com.spotify.mobile.android.ui || Class: com.spotify.mobile.android.ui.Launcher) N.B. username should be your username.

3.	Dpad (Button: Right || Repeat Times: 1) N.B. This moves the focus to the playlist

4.	Dpad (Button: Press || Repeat Times: 1) N.B. This selects a song to start playing

5.	Wait (Seconds: 5)

6.	Send Intent (Action: com.spotify.mobile.android.ui.action.player.SHOW || Package: com.spotify.mobile.android.ui || Class: com.spotify.mobile.android.ui.activity.MainActivity || Target: Activity) N.B. This switches the display to the now playing screen.

I’m sure I could have formatted this better, and there are improvements to be made, sometimes it will start playing a song but with no audio. I think this is a Spotify bug when it is initiated without being closed properly before hand.

Intents are potentially very powerful in tasker, try using a logcat, performing an action in an app and see what intent is being used!

---------- Post added at 08:20 AM ---------- Previous post was at 08:09 AM ----------

I agree about having pass/fail blank.

For passing variables to tasker, you can always use get voice within a task to do the same thing. I do this with the Spotify example above.