<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Any idea why this batch is failing to run?]]></title><description><![CDATA[<p dir="auto">Hi.  Ever since IFTTT and Alexa stopped working, I started making a bunch of TriggerCMD triggers to fill in the void.  I made a website to log health data (calories eaten, exercise done, etc).  So I made a batch file:</p>
<pre><code>@echo off
echo %1 %2 %3 %4 %5 &gt;&gt;log.txt
if "%1"=="med" goto :medication
if "%1"=="bedtime" goto :bed
c:\misc\wget.exe "https://mysite.com/index.php?m=api&amp;sm=food&amp;food=%1"
goto :eof

:medication
if "%2"=="fi8" c:\misc\wget.exe "https://mysite.com/index.php?m=api&amp;sm=insulin&amp;type=fast&amp;amt=8"&amp;goto :eof
if "%2"=="fi10" c:\misc\wget.exe "https://mysite.com/index.php?m=api&amp;sm=insulin&amp;type=fast&amp;amt=10"&amp;goto :eof
if "%2"=="fi12" c:\misc\wget.exe "https://mysite.com/index.php?m=api&amp;sm=insulin&amp;type=fast&amp;amt=12"&amp;goto :eof
if "%2"=="fi14" c:\misc\wget.exe "https://mysite.com/index.php?m=api&amp;sm=insulin&amp;type=fast&amp;amt=14"&amp;goto :eof
if "%2"=="fi18" c:\misc\wget.exe "https://mysite.com/index.php?m=api&amp;sm=insulin&amp;type=fast&amp;amt=18"&amp;goto :eof
if "%2"=="li50" c:\misc\wget.exe "https://mysite.com/index.php?m=api&amp;sm=insulin&amp;type=long&amp;amt=50"&amp;goto :eof
if "%2"=="night" c:\misc\wget.exe "https://mysite.com/index.php?m=api&amp;sm=nightmeds"&amp;goto :eof

c:\misc\wget.exe "https://mysite.com/index.php?m=api&amp;sm=meds&amp;mid=%2&amp;units=%3"
goto :eof

:bed
echo %2 &gt;&gt;log.txt
</code></pre>
<p dir="auto">I have a bunch of commands.  Here is a sample:</p>
<pre><code>Trigger: diet pepsi
Command: c:\misc\loghealth.bat dpepsi12
Off command: (greyed out)
Ground: foreground
Voice: diet pepsi
Voice reply: (empty)
Allow parameters: false
</code></pre>
<p dir="auto">This works great.  I say "Alexa, turn on diet pepsi" then check my health site and it has logged a can of Diet Pepsi.  I also track my bedtime/getting up times so if I feel drug out I can look at my health site and be like well yea, I slept 5 hours 12 minutes no doubt heh.  I wanted to leverage the on/off ability, figuring I'd say "Alexa turn on bedtime" to mark myself asleep and turn off to mark awake:</p>
<pre><code>Trigger: bedtime
Command: c:\misc\loghealth.bat bedtime on
Off command: c:\misc\loghealth.bat bedtime off
Ground: foreground
Voice: bedtime
Voice reply: (empty)
Allow parameters: true
</code></pre>
<p dir="auto">However, neither on nor off works.  I added the echo to log.txt lines and I never even get a log.txt, so it's not firing the batch at all.</p>
<p dir="auto">Any idea why?  Thanks!</p>
]]></description><link>https://www.triggercmd.com/forum/topic/2749/any-idea-why-this-batch-is-failing-to-run</link><generator>RSS for Node</generator><lastBuildDate>Tue, 16 Jun 2026 21:01:34 GMT</lastBuildDate><atom:link href="https://www.triggercmd.com/forum/topic/2749.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 27 Nov 2023 15:47:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Any idea why this batch is failing to run? on Mon, 27 Nov 2023 23:28:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/91">@Strahan</a>, that should work.</p>
<p dir="auto">Do you see an Alexa device called "bedtime" in the Alexa app?<br />
<img src="/forum/assets/uploads/files/1701127627250-667c86ef-d339-433a-acd2-c9d521cb6e3c-image.png" alt="667c86ef-d339-433a-acd2-c9d521cb6e3c-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">FYI, you could also remove the on and off portion of the command, and clear the "Off command" field like this because the agent will add " on" or " off" to your command depending on whether you're flipping the virtual switch on or off.</p>
<pre><code>Trigger: bedtime
Command: c:\misc\loghealth.bat bedtime
</code></pre>
<p dir="auto">At first I was concerned that bedtime might be a reserved word, but I tried "bedtime" and "bed time" in the Voice field and both worked for me.</p>
<p dir="auto"><img src="/forum/assets/uploads/files/1701127423968-82dfaf50-a9a4-4549-9f78-e8001a91b436-image.png" alt="82dfaf50-a9a4-4549-9f78-e8001a91b436-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://www.triggercmd.com/forum/post/7535</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/7535</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Mon, 27 Nov 2023 23:28:13 GMT</pubDate></item></channel></rss>