Author Topic: Gmail Title Output & Localization  (Read 3398 times)

0 Members and 1 Guest are viewing this topic.

SunDoWneR

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 0
    • View Profile
    • www.en4ce.com
Gmail Title Output & Localization
« on: October 15, 2013, 05:35:15 AM »
Hey,
currently i'm messing arround with the GMail actions and couldn't find em in the VC Folder. My problem is, that the german tts voice has to say english words which sounds quite silly.

When I'm using the {LastResult} on the titles, for example, the output is "From: myacc@mail.com Title: blah". Is there an easy way to fix this (besides changing the tts voice to eng ;D)?
Someone could also lead me to the correct spot in the Folder structure, so I could do the changes myself.
Same with the summarys.

It would also be nice to let VC write sort of a list, that the user could decide for which mail he wants to have, for example, a tts output of the summary.

Example:

- User asks "Do I have new E-Mails?"
- VC says "Yes, you have 2 new E-Mails" (Gmail.GetCount) Works!
- User asks "Read the titles"
- VC reads the titles "E-mail1: from: xxx title: xxx" (Gmail.GetAllTitles)
- User asks "Give me the summary of E-mail1"
- VC reads the summary of E-mail1 (Options: Exerpt lengh;whole Mail)
... and so on.

Cheers, Sunny
« Last Edit: October 15, 2013, 06:27:54 AM by SunDoWneR »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Gmail Title Output & Localization
« Reply #1 on: October 15, 2013, 09:10:48 AM »
The gmail actions are very old, and could certainly use an update.  Until then, you can probably still work around it pretty easily.

Here are some commands that use "replace" and "regex" to achieve what I think you want.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="gmail quick fixes" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="245" name="show new emails" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Gmail.GetAllTitles</cmdType>
      <cmdString />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.Replace</cmdType>
      <cmdString>from:&amp;&amp;von:</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.Replace</cmdType>
      <cmdString>title :&amp;&amp;titel:</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>{LastResult}&amp;&amp;4000&amp;&amp;-5</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>show new emails</phrase>
  </command>
  <command id="246" name="Get a summary" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Gmail.GetAllSummaries</cmdType>
      <cmdString />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>System.SetClipboardText</cmdType>
      <cmdString>{LastResult}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <cmdString>summary\s:\s(.*)</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)&lt;(B)</ifType>
      <ifParams>{#M}&amp;&amp;{1}</ifParams>
      <then>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <cmdString>You only have {#M} new messages</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <cmdString>{Match.{1}}</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>show summary</phrase>
    <payloadRange>1,8</payloadRange>
  </command>
</commandGroup>

SunDoWneR

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 0
    • View Profile
    • www.en4ce.com
Re: Gmail Title Output & Localization
« Reply #2 on: October 15, 2013, 10:32:29 AM »
Very nice, thx James!

Woks almost like a charm...

The "clipboardtext" doesn't accept special characters. We have a few of them in the german language, like ö ä ü ß, if you can read them. Is there a "workaround"?

Is there a way to extend the summary?


Cheers, Sunny
« Last Edit: October 15, 2013, 10:37:11 AM by SunDoWneR »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Gmail Title Output & Localization
« Reply #3 on: October 15, 2013, 10:47:22 AM »
Quote
Is there a way to extend the summary?

I don't think so.  This is what is served up by gmail's atom feed.
« Last Edit: October 15, 2013, 12:56:40 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Gmail Title Output & Localization
« Reply #4 on: October 15, 2013, 11:52:23 AM »
The "clipboardtext" doesn't accept special characters.

Clipboardtext has nothing to do with it. You can actually remove it from the command.  I was just using it when trying to figure out the regex filter.
« Last Edit: October 15, 2013, 12:57:03 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Gmail Title Output & Localization
« Reply #5 on: October 15, 2013, 12:55:59 PM »
...but the special characters I can fix.  That will be corrected in the next version of VC :)

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Gmail Title Output & Localization
« Reply #6 on: October 15, 2013, 02:35:58 PM »
James can you fix it also in confirm phrases to use "special characters" in the Options Menu->General Tab

Thanks  ;)
***********  get excited and make things  **********

SunDoWneR

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 0
    • View Profile
    • www.en4ce.com
Re: Gmail Title Output & Localization
« Reply #7 on: October 15, 2013, 04:30:40 PM »
Thx man!

In which language is VC written anyways? C++ or py or another?

Cheers, Sunny

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Gmail Title Output & Localization
« Reply #8 on: October 15, 2013, 04:33:49 PM »
C#
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: Gmail Title Output & Localization
« Reply #9 on: October 15, 2013, 08:51:22 PM »
James can you fix it also in confirm phrases to use "special characters" in the Options Menu->General Tab

Thanks  ;)

I'm not sure what you mean.  Are you using 1.163 ?  I can put  ö ä ü ß into my confirm phrases and they work fine, at least they display normally... I don't know if there is a problem with them being recognized by the speech engine.  Is that what you mean?

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Gmail Title Output & Localization
« Reply #10 on: October 17, 2013, 12:50:04 AM »
Upps, sorry  :bonk
You've right, it works. I forgot only to change the old phrases by hand.
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Gmail Title Output & Localization
« Reply #11 on: October 21, 2013, 05:36:13 PM »
Hi.  This issue should be resolved now in version 1.1.6.6. and later:

http://voxcommando.com/forum/index.php?topic=1228.0

I have also added a new action that allows you to specify the format in any language.  See the sample xml below for an example:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="261" name="get custom" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Gmail.GetCustom</cmdType>
    <cmdString>&lt;#&gt;: DER &lt;FROM&gt;, Titel: &lt;TITLE&gt;{CR}&lt;SUMMARY&gt;{CR}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <cmdString>{LastResult}&amp;&amp;4000&amp;&amp;-5</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>show new emails</phrase>
</command>