Two widget press calendar insert question.

806 views
Skip to first unread message

jeff

unread,
Jul 29, 2011, 10:30:16 AM7/29/11
to Tasker
I work at different times and I'm trying to set tasker to help me
track my times in and out. So far I've been using one widget to just
insert a time, one minute long... that I use to track my ins and outs.
I have one event for "WrkIn" and "WrkOutInsrtCal"... One enters the
time with "in" for the title and the other: "out" Just wondering if
its possible to set the first time to a variable, and either press a
2nd time or a 2nd widget to set an event using the start time and then
the current time to GCalendar. If I figure it out I'll post... been so
long since my programming class. dammit.

thanks in advance.

m.klinge

unread,
Jul 29, 2011, 11:36:44 AM7/29/11
to Tasker
It's possible however you need to create another variable to detect
each press ;)

Say we have variable called %PRESSED. Make a boot task that sets the
%PRESSED = 1 (useful to have such a boot task anyway). Then your task
should be somewhat like this:
On widget click
If %PRESSED = 1
Do [task1]
Set %PRESSED = 0
End if
If %PRESSED = 0
Do [task2]
Set %PRESSED = 1
End if

This should make you widget behave different depending on the last
press (as long as you dont clear the variable) ;)

//M


jeff skrev:

sayling

unread,
Jul 29, 2011, 6:49:47 PM7/29/11
to Tasker
I did something similar, with a desktop widget called Work, that sets
a variable called %WORK.

This initiates the start task on first tap, second task on second tap.

Tasks are:

Profile: Anon (96)
Event: Variable Set
Enter: Anon (97)
A1: Variable Set [ Name:%START To:%TIMES Do Maths:On Append:Off]
A2: Set Widget Label [ Name:Work Label:Tap to end]

Profile: Anon (98)
Event: Variable Set
Enter: Anon (99)
A1: Variable Set [ Name:%END To:%TIMES Do Maths:Off Append:Off]
A2: Variable Set [ Name:%DURA To:%END- %START/60 Do Maths:On
Append:Off]
A3: Variable Split [ Name:%DURA Splitter:. Delete Base:Off]
A4: Variable Set [ Name:%DURASTART To:%DURA1*-1 Do Maths:On
Append:Off]
A5: Calendar Insert [ In / For (Minutes):%DURASTART/%DURA1
Calendar:Google:Calendar Title:Work Today Description:What I did
Location:Where I did it Available:Off]
A6: Set Widget Label [ Name:Work Label:Tap to start]
A7: Variable Clear [ Name:%WORK Pattern Matching:Off]
A8: Variable Clear [ Name:%DURA* Pattern Matching:On]
A9: Variable Clear [ Name:%START Pattern Matching:Off]
A10: Variable Clear [ Name:%END Pattern Matching:Off]

Start and end times are rounded to the nearest minute, and the second
task creates a calendar entry with a start time equal to when you
first tapped the widget, ending when you tapped it again. And just so
you know where you are at, the label of the widget changes too!

Next thing would be to have a menu appear so you could enter details
of a title, location and description that get assigned to variables
that get used in the calendar entry itself. Might work on that myself
over the next few days and stick it up on the wiki!

sayling

unread,
Jul 30, 2011, 5:45:34 AM7/30/11
to Tasker
Hmm - couple of little bugs, so ignore the above for the moment... and
I can't work out how to bring up a menu that prompts the user to enter
a string to be stored as a variable for the calendar entries... :(

sayling

unread,
Jul 31, 2011, 5:10:25 AM7/31/11
to Tasker
Ta-da!

Profile: ApptEnd (98)
Event: Variable Set
Enter: ApptEnd (99)
A1: Variable Set [ Name:%END To:%TIMES Do Maths:Off Append:Off]
A2: Notify [ Title:T Text:%START start
%END end Icon:<icon> Number:0 Permanent:Off]
A3: Variable Set [ Name:%DURA To:%END- %START Do Maths:On Append:Off]
A4: Variable Set [ Name:%DURA To:%DURA/60 Do Maths:On Append:Off]
A5: Variable Split [ Name:%DURA Splitter:. Delete Base:Off]
A6: Notify [ Title:Dura Text:%DURA
1 %DURA1 Icon:<icon> Number:0 Permanent:Off]
A7: Variable Set [ Name:%DURASTART To:%DURA1 * -1 Do Maths:On
Append:Off]
A8: Notify [ Title:Durastart Text:%DURASTART Icon:<icon> Number:0
Permanent:Off]
A9: Calendar Insert [ In / For (Minutes):%DURASTART / %DURA1
Calendar:Google:Calendar Title:Work Today Description:What I did
Location:%LOCSHRT Available:On]
A10: Set Widget Label [ Name:Work Label:Tap to start]
A11: Variable Clear [ Name:%WORK Pattern Matching:Off]
A12: Variable Clear [ Name:%DURA* Pattern Matching:On]
A13: Variable Clear [ Name:%START Pattern Matching:Off]
A14: Variable Clear [ Name:%END Pattern Matching:Off]

I can't work out how to get user input for the calendar title and
description, though - perhaps someone else has some ideas - and the
location in the above is obtained from another task I have for getting
my current location for a weather forecast; change it to some fixed
text in yours, or get your own location variable for it.

sayling

unread,
Aug 21, 2011, 10:58:39 AM8/21/11
to Tasker
Finally posted the profiles up at
http://tasker.wikidot.com/widget-to-create-start-and-end-times-for-a-calendar-entry

On Jul 31, 10:10 am, sayling <saylin...@gmail.com> wrote:
> Ta-da!
>
>  Profile: ApptEnd (98)
>         Event: Variable Set
> Enter: ApptEnd (99)
>         A1: Variable Set [ Name:%END To:%TIMES Do Maths:Off Append:Off]
>         A2: Notify [ Title:T Text:%START start
> %END end Icon:<icon> Number:0 Permanent:Off]
>         A3: Variable Set [ Name:%DURA To:%END- %START Do Maths:On Append:Off]
>         A4: Variable Set [ Name:%DURA To:%DURA/60 Do Maths:On Append:Off]
>         A5: Variable Split [ Name:%DURA Splitter:. Delete Base:Off]
>         A6: Notify [ Title:Dura Text:%DURA
> 1 %DURA1 Icon:<icon> Number:0 Permanent:Off]
>         A7: Variable Set [ Name:%DURASTART To:%DURA1 * -1 Do Maths:On
> Append:Off]
>         A8: Notify [ Title:Durastart Text:%DURASTART Icon:<icon> Number:0
> Permanent:Off]
>         A9: Calendar Insert [ In / For (Minutes):%DURASTART / %DURA1
> Calendar:Google:Calendar Title:Work Today Description:What I did
> Location:%LOCSHRT Available:On]

Note that in the wiki, Location is set to 'Where I did it' as opposed
to %LOCSHRT. I get %LOCSHRT from another profile, which I haven't
included here...

Tim W

unread,
Feb 5, 2013, 2:48:43 AM2/5/13
to tas...@googlegroups.com
Go to the ApptEnd profiles task, open 6. Calendar Insert and choose your Calendar with the magnifying glass button.
I kept getting an error till I did that and it seems to be working fine now. I think it was/is set to Calender:Default by default.

On Friday, December 14, 2012 9:19:34 AM UTC-5, Ian Quintana wrote:
Same problem here, im not able to make it works

On Saturday, November 10, 2012 7:06:16 PM UTC+1, B Sm wrote:
I'm having the same problem... any update? Do you need any more info from me?



On Wednesday, July 25, 2012 9:44:20 AM UTC-4, licha wrote:
Hi, I know this is an old thread, but I'm hoping you still get this and respond.

I'm really new at using Tasker, and I'm having difficulty getting this widget to work. I imported the files from the Wiki and made the widget, as instructed. But when I first tap the widget, it doesn't say anything except "Work." Looking at/while editing the Task, there is a red bar next to "Variable Set." I'm confused as to what I'm supposed to do if anything.

Not sure if it's pertinent, but I'm running Holo Launcher.
Reply all
Reply to author
Forward
0 new messages