Author Topic: Webmaster needs help  (Read 2713 times)

NermiD

  • Newbie
  • *
  • Posts: 5
Webmaster needs help
« on: May 23, 2023, 12:44:51 PM »
I am a webmaster 60 and I was unfortunately had Stroke attack, which affected my right arm on my leg.

‌I miss my work people in the office, but most of all I miss my work.

‌I'm looking for some software solution with a voice to type HTML and CSS; I tried Serenade that is too complicated.

‌ Do you believe I can have a success with your software?

Nermi

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Webmaster needs help
« Reply #1 on: May 23, 2023, 01:51:08 PM »
You'll want to try the demo version, to get a feel for both the interface, and the recognition capabilities of the Microsoft speech recognition system.

Do make sure to perform the speech recognition training at least three times.


For the contents of your commands, the "Quick Input" action may be particularly relevant, as it's intended for typing out text.

Although, for larger sections of text you may opt for pasting from the clipboard instead, in which case the "Set a Text Value to the Windows Clipboard" action combined with a keypress action that presses and releases Ctrl-v (or Shift-Insert, if you prefer) could be the appropriate choice.

NermiD

  • Newbie
  • *
  • Posts: 5
Re: Webmaster needs help
« Reply #2 on: May 26, 2023, 11:00:11 AM »
Eh, if I just was able to figure out how to use mouse command, for example:

Code: [Select]
<a class="#" href="#">|</a>
to return cursor to position between "><" ? Or class... Cursor between "#"?

Nermi

SemlerPDX

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 291
  • Upstanding Lunatic
    • My AVCS Homepage
Re: Webmaster needs help
« Reply #3 on: May 26, 2023, 12:06:22 PM »
You might consider making a couple other voice commands - such a Back and Forward command (maybe Up and Down, as well).

These could be set to take a word and/or a word and number(s) - you could say, "Back 11" or "Back 5" or "Forward 3", and have your actions press the arrow keys to move the cursor for you. The number of times the key(s) are pressed can be based on the number which was said for the command.

Press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF viewer, which contains information on VoiceAttack's features, and to learn even more about these concepts I'm demonstrating below, check out these forum posts regarding use of variables and tokens, and control flow including use of loops:
Variables and tokens summed up
Control flow (If, Else, ElseIf, Loop, Jump) basics


For example:
Code: [Select]
Cursor Back [1..20;]This dynamic phrase allows for 21 command variations, you could say just "Cursor Back", or "Cursor Back 1" or ending in any number up to "Cursor Back 20" - adjust as needed, keeping the number to a reasonably low number can help keep total derived commands count low in your profile. Best to only use as high of a number as you'd reasonably use.  Same for Up, or Forward, or Down - whatever works best for you.

For example:

SemlerPDX

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 291
  • Upstanding Lunatic
    • My AVCS Homepage
Re: Webmaster needs help
« Reply #4 on: May 26, 2023, 12:32:27 PM »
It should be noted that for document editing, the Windows Speech Recognition application itself has numerous voice commands and a list of their functions can be found here:
Windows Speech Recognition Commands

We can run this application while VoiceAttack is running to use its powerful existing list of document editing commands (among others), but should be aware of any potential overlap of commands already in our active VoiceAttack profile(s) matching any in the list above - and change them accordingly to be unique in their 'When I say' phrases in VoiceAttack to avoid conflicts.

(talking about THIS thing, not Cortana!)

EricM

  • Newbie
  • *
  • Posts: 15
  • VA user since 2017
Re: Webmaster needs help
« Reply #5 on: May 26, 2023, 01:26:17 PM »
You could use a head tracker to move the mouse, and voice commands for clicking.

For quick simple typing, I use a voice command with the "When I say" field set to "type *" (without quotes), and a Quick Input action set to type "{CMD_AFTER}" (without quotes) which will render what is said immediately after the word "type" (because of the "*").

Also, NATO alphabet commands often come in handy.  e.g. alpha for "a", beta for "b", etc.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Webmaster needs help
« Reply #6 on: May 26, 2023, 04:17:05 PM »
Eh, if I just was able to figure out how to use mouse command, for example:

Code: [Select]
<a class="#" href="#">|</a>
to return cursor to position between "><" ? Or class... Cursor between "#"?
Mouse movement is very difficult to automate in the manner you're describing, as the mouse is an input device specifically designed for hand-eye coordination, meaning the user would perform the visual processing required to acquire a target on screen, and then perform the appropriate motion to place the cursor over said target.
Doing that in software is very advanced.


What would likely be a more feasible approach is to use the keyboard, as others have suggested in this topic.

Assuming the text editing cursor (the blinking bar that appears in text input controls, I.E. not your mouse cursor) is already on the line you're intending to edit, you could select the text on that line, and via the clipboard pass it to VoiceAttack, where you can then search for the appropriate set of characters, like '>' or 'class="', and perform the appropriate keyboard input to get there.

This is possible with native actions, however the issue you'd run into is that the token parser will attempt to interpret anything involving a set of curly braces as a token, which will at the very least remove said curly braces.

Because of that, I ended up going with an inline function to do the actual parsing instead.


So, an example command could look like this:
Code: [Select]
Set text [~textBeforeTarget] to 'class="'
Set text [~textAfterTarget] to ''

Press Home key and hold for 0,01 seconds and release
Press Left Shift+End keys and hold for 0,01 seconds and release
Press Left Ctrl+C keys and hold for 0,01 seconds and release
Pause 0,05 seconds
Inline C# Function: Calculate moves to target, wait until execution finishes
Press Home key and hold for 0,01 seconds and release
Start Loop : Repeat [~movesToTarget] times
    Press and release Right key
End Loop

Where "Calculate moves to target" contains:
Code: [Select]
using System;
using System.Text;
using System.Windows.Forms;

public class VAInline
{
public void main()
{
string line = Clipboard.GetText();
if (String.IsNullOrEmpty(line))
{
VA.WriteToLog("No text in clipboard", "red");
return;
}

string textBeforeTarget = VA.GetText("~textBeforeTarget") ?? "";
string textAfterTarget = VA.GetText("~textAfterTarget") ?? "";

string targetText = (textBeforeTarget + textAfterTarget).Replace("|", "");
if (targetText == "")
{
VA.WriteToLog("Invalid command configuration; neither \"~textBeforeTarget\" or \"~textAfterTarget\" are assigned text", "red");
return;
}

int targetPos = line.IndexOf(targetText);
if (targetPos == -1)
{
VA.WriteToLog("Copied line does not contain the target text \"" + targetText + "\"", "Orange");
return;
}

VA.SetInt("~movesToTarget", targetPos + textBeforeTarget.Length);
}
}


That can also easily be modified to begin from the current cursor position, rather than the beginning of the line, E.G.
Code: [Select]
Set text [~textBeforeTarget] to '>'

Press Left Shift+End keys and hold for 0,01 seconds and release
Press Left Ctrl+C keys and hold for 0,01 seconds and release
Pause 0,05 seconds
Inline C# Function: Calculate moves to target, wait until execution finishes
Press and release Left key
Start Loop : Repeat [~movesToTarget] times
    Press and release Right key
End Loop
(the inline function would be identical)


I've attached a .vap with three example commands, which can be imported using the "Import Commands" button on the "Edit a Profile" window. All three commands seem to work consistently on my machine.


Note that if you're setting either "~textBeforeTarget" or "~textAfterTarget" to a value containing a set of curly braces, you'll need to escape them using the pipe character ("|{" or "|}"); consequently, it is not possible to target pipe characters with the example inline function, as that character is removed from the input.

NermiD

  • Newbie
  • *
  • Posts: 5
Re: Webmaster needs help
« Reply #7 on: May 26, 2023, 04:21:41 PM »
Wow, it is so interesting!

Let me what else they have in rest of that Manual!

Many thanks

Nermi

NermiD

  • Newbie
  • *
  • Posts: 5
Re: Webmaster needs help
« Reply #8 on: June 19, 2023, 10:45:34 AM »
I Have a little problem when I want to write T e x t, for example, '<div style=""></div>' ;  I don't use quick text, should I?

SemlerPDX

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 291
  • Upstanding Lunatic
    • My AVCS Homepage
Re: Webmaster needs help
« Reply #9 on: June 19, 2023, 11:47:14 AM »
I Have a little problem when I want to write T e x t, for example, '<div style=""></div>' ;  I don't use quick text, should I?

Quick Input would work just fine for something like `<div style=""></div>`...

I assume this is a placeholder and you'd have some actual style between the double quotes in your example.

NermiD

  • Newbie
  • *
  • Posts: 5
Re: Webmaster needs help
« Reply #10 on: June 19, 2023, 12:24:40 PM »
No, actually I want to add text, for example, "Today is sunny day" in between '><' , but in Quick note there is no option to say it, just write it. And I noticed there's a something like 'Start dictation' and 'Stop dictation'...

SemlerPDX

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 291
  • Upstanding Lunatic
    • My AVCS Homepage
Re: Webmaster needs help
« Reply #11 on: June 19, 2023, 02:08:30 PM »
I see what you mean now.  If that is the case, you'd want to find a way to populate the text before committing this action to print out a <div> containing that text.  For example, you could engage Dictation or some other system to get the text value which should exist between `><` in your example and set this to a VoiceAttack Text Variable.

By using a Text Token you can insert the value of this variable into the string:
Code: [Select]
{TXT:exampleTextVariableName}

Then, you can set the value to the Quick Input field such as this:



...now, the subject of getting what we say into a text variable can be difficult, because Windows Speech Recognition Engine is not the best at Dictation.  If this is an issue for you and you have poor success with VA Dictation, there are options but not always free, including other dictation software, speech recognition engines, and even plugins for VoiceAttack (my OpenAI Plugin offers Whisper API functions, which perfectly turns audio files of speech into accurately transcribed text).


EDIT: I should also note that my OpenAI Plugin can also access ChatGPT through voice interaction, where you could use plain speech to describe the HTML element(s) you would like it to write, and then it would respond using text-to-speech, opening the code example in a plain notepad where it can be reviewed and/or copied into place in your .html file.  Might be a big help for you, if that's something you're interested in.

(if you're more interested in a ready-to-use profile which uses this OpenAI Plugin, check out AVCS Voice ChatGPT, links in my sig below)