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
Maybe that is the solution...
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.
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 ]