I still think this ^ is your issue instead.
Ideally, you'll want a setup that handles a variable degree of flexibility to begin scan intervals, adjusted so the checks always start for 8am that day, and 5pm that night.
This will do that:
All Events 8am To 5pm (417)
A1: Flash [ Text:Started Long:Off ]
A2: Variable Set [ Name:%time To:%TIME Do Maths:On Append:Off ]
A3: Variable Split [ Name:%time Splitter:. Delete Base:On ]
A4: Variable Set [ Name:%time1 To:(23-%time1)*60 Do Maths:On Append:Off ]
A5: Variable Set [ Name:%time2 To:60-%time2 Do Maths:On Append:Off ]
A6: Variable Add [ Name:%time1 Value:%time2 Wrap Around:0 ]
A7: Variable Set [ Name:%after_minutes To:%time1 Do Maths:On Append:Off ]
A8: Variable Set [ Name:%before_minutes To:%time1 - 1441 Do Maths:On Append:Off ]
A9: Variable Set [ Name:%minutes_end To:540 Do Maths:Off Append:Off ]
A10: Variable Add [ Name:%minutes Value:%before_minutes Wrap Around:0 ]
A11: Variable Set [ Name:%calendar_check To:%minutes * 60 Do Maths:On Append:Off ]
A12: Variable Add [ Name:%calendar_check Value:%TIMES + 28860 Wrap Around:0 ]
A13: Variable Convert [ Name:%calendar_check Function:Seconds to Long Date Time Store Result In:%calendar_begin ]
A14: Variable Set [ Name:%subtract To:10 Do Maths:Off Append:Off ]
A15: Flash [ Text:Analyzing Long:Off ]
A16: Say [ Text:Analyzing Engine:Voice:default:default Stream:5 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ] If [ %SILENT ~ off ]
<Test Anchor>
A17: Anchor
A18: Test App [ Type:Calendar Title Data:%calendar_check Store Result In:%calendar_results ]
A19: Variable Set [ Name:%results To:,%calendar_results() Do Maths:Off Append:On ] If [ %calendar_results(#) != 0 ]
A20: Variable Set [ Name:%subtract To:%minutes_end Do Maths:Off Append:Off ] If [ %minutes_end < 10 ]
A21: Variable Subtract [ Name:%minutes_end Value:%subtract ]
A22: Variable Add [ Name:%calendar_check Value:%subtract * 60 Wrap Around:0 ]
A23: Goto [ Type:Action Label Number:1 Label:Test Anchor ] If [ %minutes_end != 0 ]
A24: Flash [ Text:Analysis Complete Long:Off ]
A25: Say [ Text:Analysis complete Engine:Voice:default:default Stream:5 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ] If [ %SILENT ~ off ]
A26: Variable Convert [ Name:%calendar_check Function:Seconds to Long Date Time Store Result In:%calendar_end ]
A27: If [ %results Set ]
A28: Variable Split [ Name:%results Splitter:, Delete Base:Off ]
A29: Array Process [ Variable:%results Type:Remove Duplicates ]
A30: Array Process [ Variable:%results Type:Squash ]
A31: Array Pop [ Variable:%results Position:1 To Var: ]
A32: If [ %results(#) = 0 ]
A33: Say [ Text:No events from %calendar_begin until %calendar_end Engine:Voice:default:default Stream:5 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ] If [ %SILENT ~ off ]
A34: Else
A35: Say [ Text:According to the calendar for %calendar_begin until %calendar_end, you have %results(#) events, %results() Engine:Voice:default:default Stream:5 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:On ] If [ %SILENT ~ off ]
A36: End If
A37: Else
A38: Say [ Text:No events from %calendar_begin until %calendar_end Engine:Voice:default:default Stream:5 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ] If [ %SILENT ~ off ]
A39: End If
And here is the task uploaded for importation:
https://www.dropbox.com/s/b642z65xx59r6xf/All_Events_8am_To_5pm.tsk.xml
Hope this helps.
Thanks Brandon, I had seen your other post and I agree more accuracy would be better *but* I've created the following and if I run it at a time when there is a calendar entry with the goto disabled it works, as soon as I enable the goto it stops working (%NewEvent is never populated). I would think now (%TIMES) +600 should be a valid time?
I'll probably have to give up and just use yours but it had become a bit of a challenge!
Test 2 (260)
A1: Variable Set [ Name:%time To:%TIMES+600 Do Maths:On Append:Off ]
A2: Variable Set [ Name:%stop To:%TIMES+86500 Do Maths:On Append:Off ]
A3: Test App [ Type:Calendar Title Data:%time Store Result In:%NewEvent ]
A4: Flash [ Text:%time Long:Off ]
A5: Variable Set [ Name:%time To:%time+600 Do Maths:On Append:Off ]
A6: Goto [ Type:Action Number Number:3 Label: ] If [ %time < %stop]
--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/kossTXlwDzc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.
Test 2 (260)
A1: Variable Set [ Name:%time To:%TIMES+600 Do Maths:On Append:Off ]
A2: Variable Set [ Name:%stop To:%TIMES+86500 Do Maths:On Append:Off ]
A3: Test App [ Type:Calendar Title Data:%time Store Result In:%newevent ]
A4: Flash [ Text:%time Long:Off ]
If %newevent(#) ! eq 0 (maths doesn't equal zero)
For, var: %push items: 1:%newevent(#)
Add action: variable > array push
variable: %NewEvent
position: 999999
value: %newevent(%push)
If %NewEvent() ! R %newevent(%push) (doesn't match regex)
End For
End If
A5: Variable Add [ Name:%time Value:600 Wrap Around:0 ]
A6: Goto [ Type:Action Number Number:3 Label: ] If [ %time < %stop]
Up to you what you want to use. The problem you were having with what you were using recently is your saved results were displayed in %NewEvent() and were being replaced with each check in the loop. So, if the final check in the loop didn't have an event then no events were placed in results. With this method, results are placed in a global array only if the results don't match anything previous stored in the array.
Hope this helps too ;-)
Ah! Brilliant that makes sense :-)
Thanks for your help :-)
MattV
Read Calendars (260)
A1: Array Clear [ Name:%NewEvent ]
A2: Array Clear [ Name:%AppTime ]
A3: Variable Set [ Name:%time To:%TIMES+28800 Do Maths:On Append:Off ]
A4: Variable Set [ Name:%stop To:%TIMES+61140 Do Maths:On Append:Off ]
A5: Variable Set [ Name:%time To:%time+600 Do Maths:On Append:Off ]
A6: Test App [ Type:Calendar Title Data:%time Store Result In:%newevent ]
A7: Test App [ Type:Calendar Start (Seconds) Data:%time Store Result In:%apptime ]
A8: If [ %newevent(#) != 0 ]
A9: For [ Variable:%push Items:1:%newevent(#) ]
A10: Array Push [ Name:%NewEvent Position:999999 Value:%newevent(%push)
Fill Spaces:Off ] If [ %NewEvent() !~R %newevent(%push) ]
A11: End For
A12: End If
A13: If [ %apptime(#) != 0 ]
A14: For [ Variable:%push Items:1:%apptime(#) ]
A15: Array Push [ Name:%AppTime Position:999999 Value:%apptime(%push) Fill Spaces:Off ] If [ %AppTime() !~R %apptime(%push) ]
A16: End For
A17: End If
A18: Goto [ Type:Action Number Number:5 Label: ] If [ %time < %stop ]
A19: If [ %AppTime(1) Set ]
A20: Variable Convert [ Name:%AppTime(1) Function:Seconds to Date Time Store Result In: ]
A21: Variable Split [ Name:%AppTime(1) Splitter: Delete Base:Off ]
A22: Variable Set [ Name:%AppStart1 To:%AppTime12 Do Maths:Off Append:Off ]
A23: End If
A24: If [ %AppTime(2) Set ]
A25: Variable Convert [ Name:%AppTime(2) Function:Seconds to Date Time Store Result In: ]
A26: Variable Split [ Name:%AppTime(2) Splitter: Delete Base:Off ]
A27: Variable Set [ Name:%AppStart2 To:%AppTime22 Do Maths:Off Append:Off ]
A28: End If
A29: If [ %AppTime(3) Set ]
A30: Variable Convert [ Name:%AppTime(3) Function:Seconds to Date Time Store Result In: ]
A31: Variable Split [ Name:%AppTime(3) Splitter: Delete Base:Off ]
A32: Variable Set [ Name:%AppStart3 To:%AppTime32 Do Maths:Off Append:Off ]
A33: End If
A34: If [ %AppTime(4) Set ]
A35: Variable Convert [ Name:%AppTime(4) Function:Seconds to Date Time Store Result In: ]
A36: Variable Split [ Name:%AppTime(4) Splitter: Delete Base:Off ]
A37: Variable Set [ Name:%AppStart4 To:%AppTime42 Do Maths:Off Append:Off ]
A38: End If
A39: Variable Set [ Name:%ShowToday To:1 Do Maths:Off Append:Off ] If [ %NewEvent1 Set ]
If you look in the variables after running it what's the value of AppTime(1)?
Looking at the task it's a bit of a fudge running all the ifs, it might be better to replace it with a for loop, I couldn't get it to work though and got fed up with it!
MattV
--