Author Topic: Howto write content of a text variable to any text input field?  (Read 3910 times)

jane

  • Newbie
  • *
  • Posts: 49
Howto write content of a text variable to any text input field?
« on: February 28, 2022, 12:21:53 PM »
Sri, I must have missed something here :)
I read in the manual you can write to log or file, but what about in any input text/edit box?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Howto write content of a text variable to any text input field?
« Reply #1 on: February 28, 2022, 12:37:15 PM »
Tokens can be combined with many features, including the "Quick Input" action to type out text, or the "Set a Text Value to the Windows Clipboard" action to paste text using Ctrl-V

jane

  • Newbie
  • *
  • Posts: 49
Re: Howto write content of a text variable to any text input field?
« Reply #2 on: February 28, 2022, 05:14:56 PM »
Tokens can be combined with many features, including the "Quick Input" action to type out text, or the "Set a Text Value to the Windows Clipboard" action to paste text using Ctrl-V

I get following error trying to post/answer: CleanTalk: *** Forbidden. Please enable JavaScript. Message seems to be spam. ***

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Howto write content of a text variable to any text input field?
« Reply #3 on: February 28, 2022, 05:21:52 PM »
Do you have JavaScript disabled in your browser and/or are you using a content blocker addon? Which browser are you using?

jane

  • Newbie
  • *
  • Posts: 49
Re: Howto write content of a text variable to any text input field?
« Reply #4 on: February 28, 2022, 05:32:06 PM »
Do you have JavaScript disabled in your browser and/or are you using a content blocker addon? Which browser are you using?
I donno how to check if JavaScript is disable. Im using Google Chrome.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Howto write content of a text variable to any text input field?
« Reply #5 on: February 28, 2022, 05:40:57 PM »
This third-party website offers instructions on enabling/disabling JavaScript.

Though, clearly you are able to post at least some of the time. How often does this message show up? Are you trying multiple times to submit the posts that do come through?

jane

  • Newbie
  • *
  • Posts: 49
Re: Howto write content of a text variable to any text input field?
« Reply #6 on: February 28, 2022, 05:48:49 PM »
This third-party website offers instructions on enabling/disabling JavaScript.

Though, clearly you are able to post at least some of the time. How often does this message show up? Are you trying multiple times to submit the posts that do come through?
I checked regarding javascript and set your site to allow using it but allowance for everyone was checked.
Ill try to post messsge with code.

jane

  • Newbie
  • *
  • Posts: 49
Re: Howto write content of a text variable to any text input field?
« Reply #7 on: February 28, 2022, 05:59:09 PM »
This third-party website offers instructions on enabling/disabling JavaScript.

Though, clearly you are able to post at least some of the time. How often does this message show up? Are you trying multiple times to submit the posts that do come through?

I tried to post code in message but get same message as in previous post.

jane

  • Newbie
  • *
  • Posts: 49
Re: Howto write content of a text variable to any text input field?
« Reply #8 on: February 28, 2022, 06:08:32 PM »
This third-party website offers instructions on enabling/disabling JavaScript.

Though, clearly you are able to post at least some of the time. How often does this message show up? Are you trying multiple times to submit the posts that do come through?
tried post from MS Edge browser with code included:
Got this msg again CleanTalk: *** Forbidden. Message seems to be spam. ***

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Howto write content of a text variable to any text input field?
« Reply #9 on: February 28, 2022, 06:10:22 PM »
Try making a screenshot of the content you intended to post, and attach that, rather than using code tags

jane

  • Newbie
  • *
  • Posts: 49
Re: Howto write content of a text variable to any text input field?
« Reply #10 on: February 28, 2022, 06:21:56 PM »
Try making a screenshot of the content you intended to post, and attach that, rather than using code tags

Try to send copy text of the blue field in image.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Howto write content of a text variable to any text input field?
« Reply #11 on: February 28, 2022, 06:25:07 PM »
Give posting the text another try now, it shouldn't show that message again

jane

  • Newbie
  • *
  • Posts: 49
Re: Howto write content of a text variable to any text input field?
« Reply #12 on: February 28, 2022, 06:35:52 PM »
Give posting the text another try now, it shouldn't show that message again

Wonder why this code doesnt work
Code: [Select]
Say, 'Say, the letter of drive'  (and wait until it completes)
Pause 0,1 seconds
Wait for spoken response: 'A;C;D;E;F;G;H;I;J;K;L;M;N;O;P;Q;R;S;T;U;V;W'
Pause 2 seconds
Begin Text Compare : [Drive] Equals 'C'
    Pause 0,1 seconds
    Set Windows clipboard to 'C:\\'
    Pause 0,1 seconds
    Press Left Ctrl+V keys and hold for 0,05 seconds and release
    Pause 0,1 seconds
Else If Text Compare : [Drive] Equals 'D'
    Say, 'Choosen drive is, D'
    Pause 0,1 seconds
    Set Windows clipboard to 'D:\\'
    Pause 0,1 seconds
    Press Left Ctrl+V keys and hold for 0,05 seconds and release
    Pause 0,1 seconds
Else If Text Compare : [Drive] Equals 'E'
    Pause 0,1 seconds
    Set Windows clipboard to 'E:\\'
    Pause 0,1 seconds
    Press Left Ctrl+V keys and hold for 0,05 seconds and release
    Pause 0,1 seconds
End Condition


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Howto write content of a text variable to any text input field?
« Reply #13 on: February 28, 2022, 06:40:55 PM »
What isn't working, specifically?

I do notice you're using double backslashes, which is an escape sequence, but that shouldn't be necessary for the "Set a Text Value to the Windows Clipboard" action.

Other than that, most of the pauses are unnecessary as well, given that all of the actions are performed synchronously (I.E. the current action must finish before the next one will execute)


As the "Wait For Spoken Response" action doesn't provide any feedback on whether something was recognized, I'd recommend adding a "Write a Value to the Event Log" action that outputs the value of the "Drive" variable, so you can see what, if anything, was recognized.

jane

  • Newbie
  • *
  • Posts: 49
Re: Howto write content of a text variable to any text input field?
« Reply #14 on: February 28, 2022, 06:44:37 PM »
What isn't working, specifically?

I do notice you're using double backslashes, which is an escape sequence, but that shouldn't be necessary for the "Set a Text Value to the Windows Clipboard" action.

Other than that, most of the pauses unnecessary as well, given that all of the actions are performed synchronously (I.E. the current action must finish before the next one will execute)
It doesn't recognize what drive letter was spoken cause nothing is written to clipboard

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Howto write content of a text variable to any text input field?
« Reply #15 on: February 28, 2022, 06:47:10 PM »
If you add a "Write a Value to the Event Log" action after the "Wait For Spoken Response"action, and have it output the value of the "Drive" variable, what shows up in the log?

jane

  • Newbie
  • *
  • Posts: 49
Re: Howto write content of a text variable to any text input field?
« Reply #16 on: February 28, 2022, 07:11:15 PM »
If you add a "Write a Value to the Event Log" action after the "Wait For Spoken Response"action, and have it output the value of the "Drive" variable, what shows up in the log?
It says: t           (when I say d) . Probably miss listening what I'm saying. Ill try and see if the learning function in VA helps.

I use {TXT:Drive} for value of Drive

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Howto write content of a text variable to any text input field?
« Reply #17 on: February 28, 2022, 07:13:19 PM »
That is not a valid token...

Have you taken the time to read the "Text (and Text-To-Speech) Tokens" section of the documentation (press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF viewer)?

This topic may also be of use:
Variables and tokens summed up

jane

  • Newbie
  • *
  • Posts: 49
Re: Howto write content of a text variable to any text input field?
« Reply #18 on: February 28, 2022, 07:42:03 PM »
That is not a valid token...

Have you taken the time to read the "Text (and Text-To-Speech) Tokens" section of the documentation (press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF viewer)?

This topic may also be of use:
Variables and tokens summed up
I think You read my correction before I edited it :) I did some training in VA and now it receives the spoken letters correct. Thanks for your great help.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Howto write content of a text variable to any text input field?
« Reply #19 on: February 28, 2022, 07:52:28 PM »
Good that you got it working.
Individual letters, like short phrases in general, can be difficult to recognize accurately, as there isn't much data to go on. Therefore, having a well-trained speech recognition profile is a necessity.


Now that you have at least some understanding of using tokens, you could potentially optimize your command somewhat.

E.G.
Code: [Select]
Say, 'Say, the letter of drive'  (and wait until it completes)
Wait for spoken response: 'A;C;D;E;F;G;H;I;J;K;L;M;N;O;P;Q;R;S;T;U;V;W'
Set Windows clipboard to '{TXT:Drive}:\'
Press Left Ctrl+V keys and hold for 0,05 seconds and release
would use the letter you spoke, directly.

If you're using a non-zero "Timeout" value for the "Wait For Spoken Response" action, you may still want to use a condition to check whether a value was actually spoken, rather than the action timing out.
« Last Edit: March 01, 2022, 04:42:33 AM by Pfeil »

jane

  • Newbie
  • *
  • Posts: 49
Re: Howto write content of a text variable to any text input field?
« Reply #20 on: February 28, 2022, 08:11:14 PM »
Good that you got it working.
Individual letters, like short phrases in general, can be difficult to recognize accurately, as there isn't much data to go on. Therefore, having a well-trained speech recognition profile is a necessity.


Now that you have at least some understanding of using tokens, you could potentially optimize your command somewhat.

E.G.
Code: [Select]
Say, 'Say, the letter of drive'  (and wait until it completes)
Wait for spoken response: 'A;C;D;E;F;G;H;I;J;K;L;M;N;O;P;Q;R;S;T;U;V;W'
Set Windows clipboard to '{TXT:Drive}:\\'
Press Left Ctrl+V keys and hold for 0,05 seconds and release
would use the letter you spoke, directly.

If you're using a non-zero "Timeout" value for the "Wait For Spoken Response" action, you may still want to use a condition to check whether a value was actually spoken, rather than the action timing out.

I trained letters to recognize Norwegian pronounce which has some more difference in saying them and lesser fault in reading.

Ya, Ill use Your suggestion above to get more direct use. (and Ill change \\ to /

Next is to add a path (2-3 subpaths ) after the driveletter.