Profile to Pause/Stop/Resume a running task

188 views
Skip to first unread message

Jeremy Harris

unread,
May 6, 2014, 7:40:15 PM5/6/14
to tas...@googlegroups.com
I have some long running Say tasks that will read the paper for me, day my schedule, weather, etc... They generally are tasks running a Variable Split and Say in a loop. Some of these take 5+ minutes to complete. If I get a call in the middle of these tasks the task is stopped abruptly by the phone (not by tasker) and never completes. This makes Tasker unresponsive until a reboot (or at least clearing cache does not fix).

So I'm trying to figure out a profile for an incoming call that will either Stop the task safely (I think I can figure that one out) or ideally, Pause the task... Then another profile to Resume the task after the call.

Is it possible?

I did a quick search and drummed up so old threads that are somewhat relevant but not really what I'm looking for:

https://groups.google.com/forum/m/#!topic/tasker/OMDn9-HLyeY

http://grokbase.com/t/gg/tasker/141yj6brde/how-to-stop-a-running-task-or-multiple-tasks

Jeremy Harris

unread,
May 6, 2014, 7:52:39 PM5/6/14
to tas...@googlegroups.com
Something interesting: After reboot I opened Tasker and hit play on a TestCache task that spits out my SdCache in a variable. It actually restarted the Say task that was interrupted before reboot.

Jeremy Harris

unread,
May 6, 2014, 8:12:24 PM5/6/14
to tas...@googlegroups.com
The Stop action works well as a task paired to Phone Ringing. Still haven't figured out how to resume but I'm playing around with the ShutUp action...

Maybe that is the solution...

Jeremy Harris

unread,
May 6, 2014, 9:55:26 PM5/6/14
to tas...@googlegroups.com
After researching some about Shut Up, I found this thread which is exactly what I'm trying to do.

http://grokbase.com/t/gg/tasker/13ct0gpztr/is-there-a-pause-task-action-in-tasker

Pent says it's not possible to "pause" a Say because the entire text is already sent to the engine. That makes sense. I thought maybe my situation would be different since I've got smaller bits of Say actions running in loops but then realized that I'm back to stopping the task, not shutting up the Say.

As far as I can tell, there's no way to Pause/Resume a task. So I'll settle for the Stop on phone ringing, then restart from the beginning if I want too...

If anyone has any ideas, let me know.

Jeremy Harris

unread,
May 6, 2014, 10:39:24 PM5/6/14
to tas...@googlegroups.com
[SOLVED]

I LOVE TASKER!!!

So, I created a counter for each iteration thru the loop. I changed the For action from "%var()" to "%var(%counter:%last)" and I created an If %counter>1 Goto action before the initial Variable Set for %counter.

It works great! When phone rings it triggers Stop. When I restart task it picks up right where I left off.

I'm pleased with myself for figuring it out. Here's what it looks like...I just need to sub %last for the actual number.

Say Breaking News (92)
A1: AutoVoice Continuous [ Configuration:
Stopping continuous voice recognition Package:com.joaomgcd.autovoice Name:AutoVoice Continuous Timeout (Seconds):0 ]
A2: [X] Media Volume [ Level:15 Display:Off Sound:Off ]
A3: HTTP Get [ Server:Port:http://www.mcall.com/news/breaking/ Path: Attributes: Cookies: Timeout:10 Mime Type: Output File: Trust Any Certificate:Off ]
A4: Write File [ File:BreakingNews Text:%HTTPD Append:Off Add Newline:On ]
A5: Read File [ File:BreakingNews To Var:%BreakingNews ]
A6: Variable Split [ Name:%BreakingNews Splitter:<h3 class= Delete Base:Off ]
A7: Array Pop [ Variable:%BreakingNews Position:1 To Var: ]
A8: If [ %Counter > 1 ]
A9: Goto [ Type:Action Number Number:13 Label: ]
A10: End If
A11: Variable Set [ Name:%Counter To:1 Do Maths:On Append:Off ]
A12: Say [ Text:Here are the most recent breaking news stories from the morning call. Engine:Voice:default:default Stream:3 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ]
A13: For [ Variable:%MorningCallEvent Items:%BreakingNews(%Counter:29) ]
A14: Variable Split [ Name:%MorningCallEvent Splitter:<p class="defaultHeadlinesBrief embiggen"> Delete Base:Off ]
A15: Variable Split [ Name:%MorningCallEvent1 Splitter:title=" Delete Base:Off ]
A16: Variable Split [ Name:%MorningCallEvent12 Splitter:"> Delete Base:Off ]
A17: Variable Split [ Name:%MorningCallEvent2 Splitter:</p> Delete Base:Off ]
A18: Say [ Text:%MorningCallEvent121 Engine:Voice:default:default Stream:3 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ]
A19: Say [ Text:Here's the story. %MorningCallEvent21 Engine:Voice:default:default Stream:3 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ]
A20: Wait [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ]
A21: Variable Set [ Name:%Counter To:%Counter + 1 Do Maths:On Append:Off ]
A22: End For
A23: Delete File [ File:BreakingNews Shred Level:0 Use Root:Off ]
A24: Variable Clear [ Name:%Counter Pattern Matching:Off ]
A25: AutoVoice Continuous [ Configuration:
Starting continuous voice recognition without headset
Persistent Notification: true Package:com.joaomgcd.autovoice Name:AutoVoice Continuous Timeout (Seconds):0 ]

Reply all
Reply to author
Forward
0 new messages