CyBoRgWaR Posted November 28, 2016 Share Posted November 28, 2016 Hi , Need help on AUTO IT : no 1 : how to send a Value to Input box from the Clipboard... example : WinActivate("data.xls") ;Select excel Sleep(800) Send("^c") ; copy data from excel sheet $V = InputBox("DATA","Value") ; OPEN input box Send("^V") ; paste the value of Excel sheet Send("{ENTER}") ; gives OK.. MsgBox(0,"",$V) ; display assigned variable value. No 2 : Defining Values to Variables and conditioning with the Copied Clipboard Value.... Global $V ,$BB , $A Global $V1 = "AP" Global $V2 = "RTN" WinActivate("data.xls");Select excel Sleep(800) Send("^c");copied for the excel sheet. Sleep(800) Local $V = ClipGet() ; assigning copied value to variable $V if $V = "$V1" Then ; Here i need help , condition is IF the $V variable = AP (nothing but the copied Value) if its true then MsgBox (0,"AP","AP") elseif $V = "$V2" then MsgBox (0,"RTN","RTN"); Here same but IF condition is with RTN value. EndIf its not working for me , Please help me out.....Million of Thanks in advance..... Regards Ranjith Link to comment Share on other sites More sharing options...
mikell Posted November 28, 2016 Share Posted November 28, 2016 5 minutes ago, CyBoRgWaR said: if $V = "$V1" Then Remove the quotes around the variable Link to comment Share on other sites More sharing options...
CyBoRgWaR Posted November 28, 2016 Author Share Posted November 28, 2016 Let me try this , Link to comment Share on other sites More sharing options...
CyBoRgWaR Posted November 28, 2016 Author Share Posted November 28, 2016 No , its not working even the " was removed... Global $V ,$BB , $A Global $V1 = "AP" Global $V2 = "RTN" WinActivate("data.xls");Select excel Sleep(800) Send("^c");copied for the excel sheet. Sleep(800) Local $V = ClipGet() ; assigning copied value to variable $V if $V = $V1 Then ; Here i need help , condition is IF the $V variable = AP (nothing but the copied Value) if its true then MsgBox (0,"AP","AP") elseif $V = $V2 then MsgBox (0,"RTN","RTN"); Here same but IF condition is with RTN value. EndIf i can get the value of V if i add Msgbox of $V , but unable to do condition , with the Variables.. Link to comment Share on other sites More sharing options...
spudw2k Posted November 28, 2016 Share Posted November 28, 2016 (edited) You know what...I suspect there may be some clipboard magic going on there. When you copy a "cell" in Excel I don't think you are truly copying the text of the cell, but some kind of object/reference (just a guess). Ok, I think I found your issue. It looks like a good ol @CRLF is appended to the cell value in the clipboard. I'd still recommend using the UDF I mention below though. ;..... Global $V1 = "AP" & @CRLF ;..... You should look into the Excel UDF. I'm sure there are functions there to read the cell values you need and it is most certainly a more reliable automation method versus sequencing keystrokes. edit: link to examplehttps://www.autoitscript.com/autoit3/docs/libfunctions/_Excel_RangeRead.htm Edited November 28, 2016 by spudw2k CyBoRgWaR 1 Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
CyBoRgWaR Posted November 29, 2016 Author Share Posted November 29, 2016 12 hours ago, spudw2k said: You know what...I suspect there may be some clipboard magic going on there. When you copy a "cell" in Excel I don't think you are truly copying the text of the cell, but some kind of object/reference (just a guess). Ok, I think I found your issue. It looks like a good ol @CRLF is appended to the cell value in the clipboard. I'd still recommend using the UDF I mention below though. ;..... Global $V1 = "AP" & @CRLF ;..... You should look into the Excel UDF. I'm sure there are functions there to read the cell values you need and it is most certainly a more reliable automation method versus sequencing keystrokes. edit: link to examplehttps://www.autoitscript.com/autoit3/docs/libfunctions/_Excel_RangeRead.htm man , You are Really Great, it works like charm...... Link to comment Share on other sites More sharing options...
CyBoRgWaR Posted November 29, 2016 Author Share Posted November 29, 2016 as i got the solution for the Issue , Admins can Lock this topic now... once again , Thanks spudw2k Link to comment Share on other sites More sharing options...
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