Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error with send text
#1
This is the script:

C# code:
var w = wnd.find(1, "*(mysql)").Activate();
keys.send(@"mysqlsh");

wait.s(1); //wait 1 seconds

// press enter
keys.send(@"Enter");



wait.s(5); //wait 5 seconds

// check ClusterSet Status

keys.send(@"var clusterset = dba.getClusterSet()");

wait.s(1); //wait 5 seconds

keys.send(@"clusterset.status()");

wait.s(1); //wait 5 seconds

And I got this error:

C# code:
System.ArgumentException: Error in keys string: var clusterset = dba.get■ClusterSet■()
   at line 23 in {removed).cs
   >>
   --- Raw stack trace ---
   at Au.keys.AddKeys(String keys_)
   at Au.keys.Add(KKeysEtc[] keysEtc)
   at Au.keys.send(KKeysEtc[] keysEtc)
   at Program.<Main>$(String[] args) in (removed):line 23

I got success with mysqlsh and automated press of enter, so not sure why the next string after pressing enter got an error.
#2
By default keys.send expects key names, like "Enter". For text use prefix ! or keys.sendt.

keys.send(@"!mysqlsh");
keys.send(@"Enter");
keys.send(@"!var clusterset = dba.getClusterSet()");
keys.sendt(@"clusterset.status()");
#3
Thanks, any reason why reason why mysqlsh part was a success? 

C# code:
keys.send(@"mysqlsh");

Because I have other code like this, and it worked.

C# code:
// login to mysqlsh

var w = wnd.find(1, "*(mysql)").Activate();
keys.send(@"mysqlsh");
// press enter
keys.send(@"Enter");


//----
#4
Because m, y, s, q etc are key names. Anyway, it's not the best way to send text, because depends on the current keyboard layout.
#5
Thanks.

In the process of testing the app now that Macro Express Pro is out of business.

Great application. If it did most of the task I want, I'll chip in some donation.


Forum Jump:


Users browsing this thread: 1 Guest(s)