Author Topic: Execute after recognized command  (Read 1378 times)

IvanS

  • Newbie
  • *
  • Posts: 11
Execute after recognized command
« on: September 10, 2023, 04:58:25 PM »
I'm trying to send the recognized commands to a file.  The idea is to have a (more or less) complete transcript of what was said in a sim.  My addon logs what is produced with TTS, but I need to include what the user says. 

To interweave that, I enabled "execute command on recognized speech", to send recognized commands to a file. The addon can 'tail' that file to monitor what commands the user gives.  I've already tried it for unrecognized commands which was rather useless, I've got too bad of an accent in English apparently :-), but for recognized commands it fails. 

I get a "File not written (file already exists)" error, while everything seems to be set up fine (append to file).

Any ideas to resolve this ?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4763
  • RTFM
Re: Execute after recognized command
« Reply #1 on: September 10, 2023, 05:02:50 PM »
You mention an addon that can read the file; if said addon is not active (E.G. plugin support is disabled), does the issue still occur?

My first thought would be that the file is in use, and as such can't be written to.

IvanS

  • Newbie
  • *
  • Posts: 11
Re: Execute after recognized command
« Reply #2 on: September 10, 2023, 05:14:54 PM »
No, it was just a test for the output.  There's no code yet in the addon to access the file.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4763
  • RTFM
Re: Execute after recognized command
« Reply #3 on: September 10, 2023, 05:25:33 PM »
If you add another "Write Text to a File" action, and manually configure it to be identical, do you get the same log error message twice, or does the second action write to the file as expected?

IvanS

  • Newbie
  • *
  • Posts: 11
Re: Execute after recognized command
« Reply #4 on: September 11, 2023, 02:11:50 AM »
It's solved...  My error. 

I had added "Write Text to a File" in the commands to test with and then figured out I could do a global action on recognized commands.  So the write action was triggered by the command itself AND the global "execute command on recognized speech".  That resulted in the File lock.  I removed the action from the regular commands and now all is well.

Thanks for the support