ObjectSendText dropping characters

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
smib
Newbie
Posts: 1
Joined: Tue Nov 12, 2019 3:07 pm

ObjectSendText dropping characters

Post by smib » Tue Nov 12, 2019 3:49 pm

When sending commands to Powershell, any time a character appears multiple times in a row, only the first is kept.

Example command:
ObjectSendtext>3476822,.'%BKscripts%\SetVoltage.ps1' -portName COM7 -voltage 500

This will be changed to:
ObjectSendtext>3476822,.'%BKscripts%\SetVoltage.ps1' -portName COM7 -voltage 50

I tried using SK_DELAY, but that doesn't seem to apply to this command. Using SendText works fine, even without the delay, but I want to be able to keep Powershell minimized when sending commands.

Is there another setting that may alleviate this issue, or will I have to come up with some kludgey way to make my variables into a series of single-key entries?

Thanks in advance for any replies.

User avatar
PepsiHog
Automation Wizard
Posts: 511
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Re: ObjectSendText dropping characters

Post by PepsiHog » Thu Nov 14, 2019 7:09 pm

Bob,

I currently don't have Windows 10, so I can't truly test this. But I tried it with a dialog and it is accepted.

ObjectSendtext>3476822,{".'%BKscripts%\SetVoltage.ps1' -portName COM7 -voltage 500"}

Hope this works,
PepsiHog
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2021) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1350
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: ObjectSendText dropping characters

Post by Dorian (MJT support) » Fri Nov 15, 2019 11:33 am

I tested too and was able to replicate the problem. It seems the problem is specifically related to PowerShell, as characters weren't clipped in test applications such as NotePad. I'm wondering if that is a feature of PowerShell, as if I try "voooooltaaaaage" it is corrected to "voltage". This suggests it's a PowerShell thing and not a Macro Scheduler thing.

Unless there is a setting for this in Powershell, the workaround would be the SendText / SK_Delay option, but I do understand you said was undesirable.
Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts