Author Topic: GgCal -- what's on my agenda Monday/Tuesday/tomorrow/etc.?  (Read 2912 times)

0 Members and 1 Guest are viewing this topic.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
GgCal -- what's on my agenda Monday/Tuesday/tomorrow/etc.?
« on: February 25, 2016, 08:41:33 PM »
THIS COMMAND REQUIRES VC 2.2.1.6 OR HIGHER.

Don't forget to download the attached payload xml file to your vc\payloads subfolder.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.7-->
<command id="126" name="What's on my agenda {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)&lt;(B)</ifType>
    <ifParams>-1&amp;&amp;{1}</ifParams>
    <then>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>day</param>
          <param>{1}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>Tools.WeekdayToOffset</cmdType>
        <params>
          <param>{1}</param>
          <param>True</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>day</param>
          <param>{LastResult}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <action>
    <cmdType>GgCal.GetDay</cmdType>
    <params>
      <param>{var.day}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{#M}&amp;&amp;0</ifParams>
    <then>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <params>
          <param>You have no items on your calendar {PF.1}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <params>
          <param>On the agenda for {PF.1}:</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>On the agenda for {PF.1}:</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>OSD.AddText</cmdType>
        <params>
          <param>{Match.{i}}</param>
        </params>
        <cmdRepeat>{#M}</cmdRepeat>
      </action>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>{Match.{i}}</param>
        </params>
        <cmdRepeat>{#M}</cmdRepeat>
      </action>
    </else>
  </if>
  <phrase>What's on my</phrase>
  <phrase>agenda,schedule</phrase>
  <phrase optional="true">for,on</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\weekdays.xml</payloadFromXML>
</command>
« Last Edit: June 01, 2016, 08:35:39 AM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

DieterClaeys

  • Jr. Member
  • **
  • Posts: 10
  • Karma: 1
    • View Profile
Re: GgCal -- what's on my agenda Monday/Tuesday/tomorrow/etc.?
« Reply #1 on: May 31, 2016, 09:04:23 PM »
Looks like an awsome feature.
I have added it to my voxcommando setup. unfortunately I can't get is working.
I succesfully added the xml as well as the payloads.

It does execute it as well when I call it, but it does not repond correctly.
It always displays: "You have no items on your calendar today", but in reality I have.

I have the GgCal.QuickAdd working fine with my google calendar, so I have no idea what I am doing wrong :-(

The GetEvents button in the GgCal Plugin Settings does work, a pop up is show with all my events for the day I request.
« Last Edit: May 31, 2016, 11:25:27 PM by DieterClaeys »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: GgCal -- what's on my agenda Monday/Tuesday/tomorrow/etc.?
« Reply #2 on: June 01, 2016, 08:35:13 AM »
Hi Dieter, welcome to the forum.

I have updated the command above. Let me know if it fixes the problem.

Sometime after I posted that solution, a minor change was made to the WeekdayToOffset action and one of the logic blocks in my command was not correctly handling it.

If the new command doesn't fix the problem you're having, we probably need to see your log in order to diagnose which line of the command is not working for you. http://voxcommando.com/mediawiki/index.php?title=Log
« Last Edit: June 01, 2016, 08:39:22 AM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

DieterClaeys

  • Jr. Member
  • **
  • Posts: 10
  • Karma: 1
    • View Profile
Re: GgCal -- what's on my agenda Monday/Tuesday/tomorrow/etc.?
« Reply #3 on: June 01, 2016, 11:17:26 AM »
How stupid of me to not check the history, sorry about that :-(
I have 2 Errors.

The first error I have is:
 --> Tools WeekdayToOffset:friday&&True "Error: Parameter for day of week should be an integer or the name of a day of the week.

The second error I have is:
 -->GgCal.GetDay - Reminders Log 2.0- "Error: System FormatException: Input string was not in a correct format.

I believe the 2nd is a result of the first.

Again, thanks for this XML Exchange and all the help!

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: GgCal -- what's on my agenda Monday/Tuesday/tomorrow/etc.?
« Reply #4 on: June 01, 2016, 11:33:02 AM »
If your locale is set to one that does not use English then you will need to change the payloadXML to use values that correspond to the days of the week in your current locale / language.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: GgCal -- what's on my agenda Monday/Tuesday/tomorrow/etc.?
« Reply #5 on: June 01, 2016, 11:36:32 AM »
Even if you're using VC in English, the action uses whatever culture your OS is set to.

If you want to use VC in English, just change the payloadXML so that the days of the week *phrases* are in English, but the values are in the language that your OS expects. (In the command above, the values in the weekdays.xml payload file have been left empty because they are not needed.)

If you double-click on the payload xml in your command tree, that will open the payload xml editor so that you can modify the table.

« Last Edit: June 02, 2016, 09:17:18 AM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: GgCal -- what's on my agenda Monday/Tuesday/tomorrow/etc.?
« Reply #6 on: June 01, 2016, 11:41:39 AM »
OR you can leave the payloadXML as it is and force VC to use a different culture with the action

VC.SetCulture    en-US

However, this might affect how some of your other actions work.

DieterClaeys

  • Jr. Member
  • **
  • Posts: 10
  • Karma: 1
    • View Profile
Re: GgCal -- what's on my agenda Monday/Tuesday/tomorrow/etc.?
« Reply #7 on: June 01, 2016, 08:17:17 PM »
Hi James,

I believe that I got it working, changing the values in the payload to Dutch days did the trick.

Thanks for the help!