Jump to content
Sign in to follow this  
Guest rathore

Serialfeed

Recommended Posts

Guest rathore

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 )

Share this post


Link to post
Share on other sites
Jos

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 )

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Guest rathore

oh okay... thanx! :whistle:

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×