elmer92413 Posted February 3, 2005 Posted February 3, 2005 WinWaitActive("Microsoft Excel - Voice Mailboxes.xls") Sleep(5000) Global $array Do Send("^c") $clipboard = ClipGet() $array = StringSplit($clipboard, ",") $firstName = $array[2] $lastName = $array[1] ClipPut($firstName & " " & $lastName) Send("^v") Send("{DOWN}") Until $clipboard = "" When it copies into Excel it uses two cells... The original cell, where I want it to go... And the cell below it, where the next name is... It then moves "Down" Tries to loops but when it copies just one name $array[2] returns an error...!!! It doesn't exist the second time... Does anybody know what I am doing wrong or how to correct this...??? Is this code just not possible or what...???
herewasplato Posted February 3, 2005 Posted February 3, 2005 WinWaitActive("Microsoft Excel - Voice Mailboxes.xls") Sleep(5000) Global $array Do Send("^c") $clipboard = ClipGet() $array = StringSplit($clipboard, ",") $firstName = $array[2] $lastName = $array[1] ClipPut($firstName & " " & $lastName) Send("^v") Send("{DOWN}") Until $clipboard = ""When it copies into Excel it uses two cells... The original cell, where I want it to go...And the cell below it, where the next name is...It then moves "Down"Tries to loops but when it copies just one name $array[2] returns an error...!!!It doesn't exist the second time...Does anybody know what I am doing wrong or how to correct this...???Is this code just not possible or what...??? <{POST_SNAPBACK}>Try StringStripWS($clipboard, 8) before your stringsplitI do not think that you will ever get$clipboard = "" since you are assiging " " within the loopThat is all that I can suggest at the moment - got to run... [size="1"][font="Arial"].[u].[/u][/font][/size]
elmer92413 Posted February 3, 2005 Author Posted February 3, 2005 After looking futher into this... I have come to the conclusion that for some reason when you copy a cell you get a carriage return at the end... I have tried stripping the carriage return but to no avail... I am going to try to replace it with white space... ... .. .
Blue_Drache Posted February 3, 2005 Posted February 3, 2005 After looking futher into this...I have come to the conclusion that for some reason when you copy a cell you get a carriage return at the end...I have tried stripping the carriage return but to no avail...I am going to try to replace it with white space... ......<{POST_SNAPBACK}>Per the docs, StringStripWS($string,8) should give you the value with no whitespace and no @cr/@lf/@crlf. Whitespace includes Chr(9) thru Chr(13) which are HorizontalTab, LineFeed, VerticalTab, FormFeed, and CarriageReturn. Whitespace also includes the null string ( Chr(0) ) and the standard space ( Chr(32) ). Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache
elmer92413 Posted February 3, 2005 Author Posted February 3, 2005 Per the docs, StringStripWS($string,8) should give you the value with no whitespace and no @cr/@lf/@crlf. <{POST_SNAPBACK}>Nope doesn't work...I even stopped my script before it pasted back into Excel and manually pasted it into NotePad and still got it on two lines...!!!I am going to try a new approach and have it pasted into NotePad and backspace to get ride of the carriage return...Hopefully it works...
elmer92413 Posted February 3, 2005 Author Posted February 3, 2005 I got it to work...!!! I made it paste into NotePad and then Backspace to manually ge rid of the carriage return... WinWaitActive("Microsoft Excel - Voice Mailboxes.xls") Run("notepad.exe", "", @SW_MINIMIZE) Sleep(1000) Global $array Global $arranged Send("^c") Do WinActivate("Untitled - Notepad") Send("^v{BS}{SHIFTDOWN}{CTRLDOWN}{HOME}{SHIFTUP}{CTRLUP}^x") WinActivate("Microsoft Excel - Voice Mailboxes.xls") $clipboard = ClipGet() $array = StringSplit($clipboard, ",") $firstName = $array[2] $lastName = $array[1] $arranged = String($firstName & " " & $lastName) ClipPut($arranged) Send("^v") Send("{DOWN}") Send("^c") Until $clipboard = "" The only problem now was that it won't scroll past the bottom of the screen... But it's not that big of a deal if you scroll out far enough... Thanks for all the input...!!! ... .. .
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