Rigest Posted June 3, 2010 Posted June 3, 2010 (edited) Hi everyone, I'm building my first script with AutoIT. First off, I want to thank this community for all the information on the forum. I really learned a lot from reading here, so thanks for that. I really don't know a lot about pc's, but with logic and a lot of reading I've come a long way. Unfortunatly, I've encountered my first bump in my script. What I want is to copy a name of a client from a certain system (AS400). The problem is that the last names of the clients differ in length. So if I copy it with the Send command, some clients have a lot of spacebars behind their name. E.g. Mr. Jan Mr. Oebekistan So if the script copies the names you get: Jan <-- useless space Oebekistan<--- perfect fit Because the names will be used in a letter I need a way to only copy the name of the client. My idea was to recognise the useless space and delete them. I really don't have a clue how I would do that. Anyone have a good suggestion? Thank you in advanche. P.s. English isn't my first language, so there are probably a lot of gramatical and spelling errors. Sorry about that! Edited June 3, 2010 by Rigest
Rigest Posted June 3, 2010 Author Posted June 3, 2010 Look into StringStripWSThank you for youre quick response! It looks like that should work perfectly. Cheers!
Rigest Posted June 24, 2010 Author Posted June 24, 2010 (edited) Thank you for youre quick response! It looks like that should work perfectly. Cheers! So I've been trying a lot of stuff, but I can't get the above working. The problem is that I copy a number (sometimes with leading spaces) and I want to delete those spaces when I paste it. Send ("{DOWN}") Send ("{RIGHT}{RIGHT}") Send ("{^ DOWN}") Send ("C") Send ("{^ UP}") WinWaitActive("FICRES. - Windows Internet Explorer") Sleep(100) MouseClick ( "left", 248,396) Sleep(100) MouseClick ( "left", 382,238) Sleep(100) MouseClick ( "left", 763,381) StringStripWS ( "string", 1 ); the copied input has to be on the place where it says "string" Sleep (100) Send ("{^ DOWN}") Send ("V") Send ("{^ UP}") But how do I get the copied input in the string function? Edited June 24, 2010 by Rigest
ResNullius Posted June 26, 2010 Posted June 26, 2010 @Rigest,You need to get your copied string from the clipboard into a variable to use the StringStripWS() function on it.Send ("{DOWN}") Send ("{RIGHT}{RIGHT}") Send ("{^ DOWN}") Send ("C") Send ("{^ UP}") $sCopiedString = ClipGet() ; <<< get the clipboard contents into a variable WinWaitActive("FICRES. - Windows Internet Explorer") Sleep(100) MouseClick ( "left", 248,396) Sleep(100) MouseClick ( "left", 382,238) Sleep(100) MouseClick ( "left", 763,381) $sStrippedString = StringStripWS($sCopiedString, 1 ); <<< Strip the leading WS and store the result in another variable ClipPut($sStrippedString) ; <<< Put the stripped variable back into the clipboard ready for pasting Sleep (100) Send ("{^ DOWN}") Send ("V") Send ("{^ UP}")Having said all that, it may be better to bypass the clipboard copy/paste entirely if you can.Would you be able to use ControlGetText() and ControlSetText() instead?
Confuzzled Posted June 27, 2010 Posted June 27, 2010 Hi everyone, Mr. Jan Mr. Oebekistan So if the script copies the names you get: Jan <-- useless space Oebekistan<--- perfect fit Because the names will be used in a letter I need a way to only copy the name of the client. My idea was to recognise the useless space and delete them. I really don't have a clue how I would do that. Anyone have a good suggestion? Thank you in advanche. P.s. English isn't my first language, so there are probably a lot of gramatical and spelling errors. Sorry about that! So I've been trying a lot of stuff, but I can't get the above working. The problem is that I copy a number (sometimes with leading spaces) and I want to delete those spaces when I paste it. WinWaitActive("FICRES. - Windows Internet Explorer") FICRES: A venture capital firm based in Lagos, Nigeria with expertise in marketing, strategy, new company development, turnarounds and investment finance. We are experienced in mass marketing. Are you working on perfecting the form letter that makes the common spam/scam letters received in their millions more plausible? Dear Sir/Madam <insert victim name here>MR jan SMITH I am the bringer of goodly news that one of your distant relative, <name of relative>MR OBOKU OEBEKISTAN that was a minister in the now defunct <insert plausible sounding important company name>FINANCIAL MINSITRY of the state of nigeria has died without living a will. as you are the most closest relative of the said <name of relative>MR OBOKU OEBEKISTAN we are willing to assist in getting the sum of <insert large amount>$60,000,000 SIXTY MILLION US DOLLARS to you as your rightful inheritance. To assist in the transfer of the money to you, as the rightful heir to the late <name of relative>MR OBOKU OEBEKISTAN you will need to pay a small processing fee of <insert how much money you wish to scam from the victim>$15,000 to pay for incidentals such as local taxes, insurance, and bank clearance fees. Please send you full name and bank account details to Mr... blah, blah, blah OrWhat I want is to copy a name of a client from a certain system (AS400).are you just trying to hack the victims bank account after you receive their personal banking details in response to your form letter? They have a name for this kind of advance fee fraud automated scamming: "419" for the section of the Nigerian Criminal Code that regulates this activity. Of course, I could be wrong, but my overflowing honeypot inbox and bull$hit meter are telling me otherwise...
Valik Posted June 27, 2010 Posted June 27, 2010 Confuzzled, I'm not seeing the link you are. In the future, please refrain from jumping to such conclusions publicly.
Bert Posted June 27, 2010 Posted June 27, 2010 Valik, I see the leap, but it is a horrible stretch. In the code, it used the word "FICRES". However, the OP speaks of AS400, which is a mainframe type app if I remember it right. The last time I dealt with it was 13 years ago, so I may be WAY off based. The Vollatran project My blog: http://www.vollysinterestingshit.com/
jchd Posted June 27, 2010 Posted June 27, 2010 AS/400 series is now called IBM i and still an important part of IBM server offer today (v7.1 released recently). This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
Rigest Posted June 30, 2010 Author Posted June 30, 2010 AS/400 series is now called IBM i and still an important part of IBM server offer today (v7.1 released recently).Yes you are correct. It's a system we use at my work. So don't worry, I'm not a scammer/spammer, though I can understand that my bad English may have lead you to that conclusion =P.@ ResNullius: Tnx, that should work just fine!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now