Eh, if I just was able to figure out how to use mouse command, for example:
<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:
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:
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.
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.