Matching %DATE

105 views
Skip to first unread message

Matt

unread,
May 14, 2013, 10:33:41 AM5/14/13
to tas...@googlegroups.com
I'm trying to set up a Task to run when 2 contexts are active but only run once per day.

Below is the task I'm trying:

Sync (274)
A1: Read File [ File:Tasker/backupdate.txt To Var:%lastbackup ] 
A2: If [ %DATE ~ %lastbackup ]
A3: Stop [ With Error:Off Task: ] 
A4: End If 
A5: FolderSync [ Configuration:Tasker Backup Package:dk.tacit.android.foldersync.full Name:FolderSync ] 
A6: FolderSync [ Configuration:Tasker Files Package:dk.tacit.android.foldersync.full Name:FolderSync ] 
A7: FolderSync [ Configuration:Zoom Package:dk.tacit.android.foldersync.full Name:FolderSync ] 
A8: FolderSync [ Configuration:Zoom Files Package:dk.tacit.android.foldersync.full Name:FolderSync ] 
A9: Write File [ File:Tasker/backupdate.txt Text:%DATE Append:Off Add Newline:On ] 

I've tried swapping %DATE and %lastbackup and tis doesn't work.

I've also put a flash %DATE %lastbackup in and this looks correct

Not sure what I'm doing wrong.

Thanks

Matt

Matt

unread,
May 14, 2013, 10:37:48 AM5/14/13
to tas...@googlegroups.com
I've also tried setting another variable to %DATE and comparing %lastbackup to %myvar but that doesn't work either...

Matt

Matt

unread,
May 14, 2013, 10:58:26 AM5/14/13
to tas...@googlegroups.com
Hmm using Maths Equals seems to work, although not sure how with a date in the format 14-05-2013...

Bob Hansen

unread,
May 14, 2013, 11:18:43 AM5/14/13
to tas...@googlegroups.com
I ran into this also, but not with a date. In my case it was a number.
When a variable is written to a file and then read back to a variable a hidden character is added to the variable. When you use a (~) match comparison the variables compared don't match, but an (=) equals comparison does match.

It is definitely a bug.

Bob Hansen

unread,
May 14, 2013, 6:00:04 PM5/14/13
to tas...@googlegroups.com
I created a file where Tasker saved a variable value (multi digit number) to a file.
I then opened the file with a hex editor and found that a hex 0A (line feed) character was added.
When Tasker does a File>Read Line it gets the line contents which includes the 0A character and assigns that to a variable.

The thing to know is that when working with number in Tasker it is best to use = when checking for two numbers being the same.

TaskerAholic

unread,
May 15, 2013, 1:51:48 AM5/15/13
to tas...@googlegroups.com
Now, I understand why it did not work... 
Bob, Good info.  

Thanks

2013년 5월 15일 수요일 오전 7시 0분 4초 UTC+9, Bob Hansen 님의 말:

Matt

unread,
May 15, 2013, 5:57:29 AM5/15/13
to tas...@googlegroups.com
Ah that would be why then! Many thanks for the tip.
Reply all
Reply to author
Forward
0 new messages