Jump to content

Recommended Posts

Guest rathore
Posted

nothing advanced ... nothing difficult... but comes handy to me at many times so thought of submitting.

if while entering serial nos. in applications which have 4 or 5 boxes which in turn require 5-6 characters each, you hate it when you can't just copy-paste, then you will like this script. this sends chars and strips whitespaces & dash (minus) while doing so.

$serial = InputBox ( 'Enter Serial Number', 'Enter serial number with or without -' )
if $serial='' then Exit 


Do
    $serial = StringReplace( $serial, '-', '' )
    $pos = StringInStr($serial, "-")
until $pos = 0

Do
    $serial = StringReplace( $serial, ' ', '')
    $spos = StringInStr($serial, " ")
until $spos = 0

SplashTextOn ( 'Select', 'Select the window' & @LF & 'in next 4 seconds.', 150, 75 )
WinMove ( 'Select', '', 1, 1, 150, 75 )
Sleep ( 4000 )
SplashOff ( )
Send ( $serial )
  • Developers
Posted

Just a minor remark: You don't need the DO/Until loops because the StringReplace will replace all occurrences of the search string.

$serial = InputBox ( 'Enter Serial Number', 'Enter serial number with or without -' )
if $serial='' then Exit 
$serial = StringReplace( $serial, '-', '' )
$serial = StringReplace( $serial, ' ', '')
SplashTextOn ('Select', 'Select the window' & @LF & 'in next 4 seconds.', 150, 75,1,1 )
Sleep ( 4000 )
SplashOff ( )
Send ( $serial )

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...