How to read google calendar events filtered by title, selects one and send contents via whatsapp

37 views
Skip to first unread message

Pierpaolo Sasia

unread,
Mar 2, 2026, 6:13:25 AM (10 days ago) Mar 2
to Tasker
Dear Sirs,
I'm new to Tasker programming...
I need to filter Google Calendar events based on the title using an input variable (even if only partially matching it). Then I'd like to select the desired event and enter its content (day, time, and description) into a message to send to a WhatsApp contact I select. I tried to get AI to help me prepare the code, but it still doesn't work.
I'm attaching the XML file AI prepared for me (which, by the way, I can't even import into Tasker!)
Can you help me?
Thanks!

<TaskerData sr="" dvi="1" tv="6.6.20">
<Profile sr="prof1" ve="2">
<cdate>1700000000000</cdate>
<edate>1700000000000</edate>
<flags>8</flags>
<id>1</id>
<mid0>1</mid0>
<nme>Invia Evento WhatsApp</nme>
<Event sr="con0" ve="2">
<code>3</code>
</Event>
</Profile>

<Task sr="task1">
<cdate>1700000000000</cdate>
<edate>1700000000000</edate>
<id>1</id>
<nme>Invia Evento WhatsApp</nme>

<!-- INPUT FILTER -->
<Action sr="act1" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">Filtro titolo evento</Str>
<Str sr="arg1" ve="3">%Filtro</Str>
</Action>

<!-- QUERY CALENDAR -->
<Action sr="act2" ve="7">
<code>123</code>
<Int sr="arg0" val="0"/>
<Str sr="arg1" ve="3">%TIMES</Str>
<Str sr="arg2" ve="3">%TIMES+7d</Str>
</Action>

<!-- RESET LISTA -->
<Action sr="act3" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%Lista</Str>
<Str sr="arg1" ve="3"></Str>
</Action>

<!-- FOR LOOP -->
<Action sr="act4" ve="7">
<code>37</code>
<Str sr="arg0" ve="3">%i</Str>
<Str sr="arg1" ve="3">1</Str>
<Str sr="arg2" ve="3">%title(#)</Str>
</Action>

<!-- FILTER TITLE -->
<Action sr="act5" ve="7">
<code>6</code>
<Str sr="arg0" ve="3">%title(%i)</Str>
<Str sr="arg1" ve="3">~R</Str>
<Str sr="arg2" ve="3">(?i)%Filtro</Str>
</Action>

<!-- FORMAT DATA -->
<Action sr="act6" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%DataTmp</Str>
<Str sr="arg1" ve="3">%begin(%i)</Str>
</Action>

<Action sr="act7" ve="7">
<code>595</code>
<Str sr="arg0" ve="3">%DataTmp</Str>
<Int sr="arg1" val="3"/>
</Action>

<!-- APPEND LISTA -->
<Action sr="act8" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%Lista</Str>
<Str sr="arg1" ve="3">%DataTmp - %title(%i)</Str>
<Int sr="arg2" val="1"/>
</Action>

<Action sr="act9" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%Indice(%Lista(#))</Str>
<Str sr="arg1" ve="3">%i</Str>
</Action>

<Action sr="act10" ve="7">
<code>38</code>
</Action>

<Action sr="act11" ve="7">
<code>39</code>
</Action>

<!-- SORT -->
<Action sr="act12" ve="7">
<code>596</code>
<Str sr="arg0" ve="3">%Lista</Str>
</Action>

<!-- MENU -->
<Action sr="act13" ve="7">
<code>550</code>
<Str sr="arg0" ve="3">Seleziona evento</Str>
<Str sr="arg1" ve="3">%Lista()</Str>
<Str sr="arg2" ve="3">%Scelta</Str>
</Action>

<Action sr="act14" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%EventoIndex</Str>
<Str sr="arg1" ve="3">%Indice(%Scelta)</Str>
</Action>

<!-- MESSAGE -->
<Action sr="act15" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%Messaggio</Str>
<Str sr="arg1" ve="3">📅 %title(%EventoIndex)
🕒 %begin(%EventoIndex)
📝 %description(%EventoIndex)</Str>
</Action>

<Action sr="act16" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">Modifica messaggio</Str>
<Str sr="arg1" ve="3">%Messaggio</Str>
<Str sr="arg2" ve="3">%MessaggioFinale</Str>
</Action>

<!-- SELECT CONTACT -->
<Action sr="act17" ve="7">
<code>563</code>
<Str sr="arg0" ve="3">%Numero</Str>
</Action>

<!-- URL ENCODE -->
<Action sr="act18" ve="7">
<code>595</code>
<Str sr="arg0" ve="3">%MessaggioFinale</Str>
<Int sr="arg1" val="2"/>
</Action>

<!-- OPENWHATSAPP -->
<Action sr="act19" ve="7">
<code>877</code>
<Str sr="arg0" ve="3">android.intent.action.VIEW</Str>
<Str sr="arg1" ve="3">https://api.whatsapp.com/send?phone=%Numero&amp;text=%MessaggioFinale</Str>
<Str sr="arg2" ve="3">com.whatsapp</Str>
</Action>

</Task>
</TaskerData>

aa6vh

unread,
Mar 2, 2026, 10:47:54 AM (10 days ago) Mar 2
to Tasker
You must be new to tasker! Computers read XML, not people. Export your task in "Description" format so that us humans can read it.

Pierpaolo Sasia

unread,
Mar 4, 2026, 10:01:58 AM (8 days ago) Mar 4
to Tasker

Sorry!!
I exported the Tasker Action as a description. 

I need to filter Google Calendar events based on the title using an input variable (even if only partially matching it). Then I'd like to select the desired event and enter its content (day, time, and description) into a message to send to a WhatsApp. The code ends with copying the message to the clipboard. That's enough for me.

Here is the task code:

Attività: Event2WA
    
    A1: Variabile Query [
         Titolo: Patient
         Variabile: %TitleFilter
         Tipo di Inserimento: Testo Normale
         Layout: Variable Query
         Timeout (Secondi): 104
         Mostra Sul Bloccaschermo: On ]
    
    A2: Aggiungi Variabile [
         Nome: %EndTime
         Valore: %TIMES + 5184000
         Riavvolgere: 0 ]
    
    A3: Ottieni Eventi Calendario [
         Calendario: Google:Famiglia
         Ora di Inizio: %TIMES
         Ora di Fine: %EndTime
         Titolo: %TitleFilter ]
    
    A4: If [ %ce_title(#) = 0 ]
    
        A5: Flash [
             Testo: No Events found
             Lungo: On
             Ignora al Click: On ]
    
    A6: End If
    
    A7: Finestra Elenco [
         Modalità: Select Single Item
         Titolo: Select Events
         Oggetti: %ce_title(#)
         Chiudi Dopo (Secondi): 30
         Primo Indice Visibile: 1 ]
    
    A8: Cerca Variabile e Sostituisci [
         Variabile: %ce_title
         Ricerca: %ld_selected_index
         Salva Risultato In: %Index ]
    
    A9: Analizza/Formatta DataOra [
         Tipo di Inserimento: Secondi dall'Epoca
         Input: %ce_start_time(%Index)
         Formato di Output: dd/MM/yyyy HH:mm
         Tipo Offset di Output: Nessuno ]
    
    A10: Imposta Variabile [
          Nome: %EventDescription
          A: %ce_description(%Index)
          Struttura Output (JSON, ecc): On ]
    
    A11: Imposta Variabile [
          Nome: %Message
          A: "Prossimo appuntamento: *" + %EventDate + "*"
          Struttura Output (JSON, ecc): On ]
    
    A12: Imposta Appunti [
          Testo: %Message ]

Unfortunately, the commands are in Italian!
Thank you very much,

Best Regards,

Pierpaolo

Reply all
Reply to author
Forward
0 new messages