stiv Posted September 16, 2021 Share Posted September 16, 2021 (edited) Buen Dia compañeros de Autoit, soy nuevo en este lenguaje y quiero saber si hay alguna forma que cuando se copie una variable con mouseclip o sellecionar una variable de un block de notas (contrl C ), se pueda comparar con una columna de excel para realizar un condicional siendo igual a un mismo valor. Estaré atento Gracias lo interpreto algo asi. Translation: Good morning, colleagues from Autoit, I am new to this language and I want to know if there is any way that when copying a variable with mouseclip or selecting a variable from a notepad (contrl C), it can be compared to an excel column to perform a conditional being equal to a same value. I am waiting Thanks I interpret it something like this. WinActivate("notas pendientes: Bloc de notas") Sleep(500) Send("{CTRLDOWN}e{CTRLUP}") Sleep(500) Send("{CTRLDOWN}c{CTRLUP}") Local $sData2 = ClipGet() ;--------------------------------- With $oExcel .Range("F1:F10").Select ;Select F1:F10 COLUMNA QUE QUIERO COMPARAR .Selection.FormatConditions.Delete ;Delete Existing FormatConditions EndWith Send("{CTRLDOWN}c{CTRLUP}") Local $sData2 = ClipGet() If StringInstr($Copy,$oExcel,0) then PROCESO A REALIZAR Edited September 16, 2021 by Melba23 Added trans and code tags Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 16, 2021 Moderators Share Posted September 16, 2021 (edited) Moved to the appropriate forum. Moderation Team P.S. 1. I can understand your Spanish, but this is an English-speaking forum - please use a translation website before posting in future. 2. When you post code in future please use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above now I have added the tags. Thanks in advance for your cooperation in these matters. Edited September 16, 2021 by Melba23 Exit 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Danyfirex Posted September 17, 2021 Share Posted September 17, 2021 Hello. I think you want to do something like this: Hola. Creo que quieres hacer algo como esto: #include <Misc.au3> #include <MsgBoxConstants.au3> HotKeySet("{ESC}", "_Exit") Global Const $g_hDLL = DllOpen("user32.dll") _Main() Func _Main() While Sleep(30) If _IsPressed("11", $g_hDLL) Then If _IsPressed("43", $g_hDLL) Then _DoSomething() EndIf EndIf WEnd EndFunc ;==>_Main Func _Exit() DllClose($g_hDLL) EndFunc Func _DoSomething() Local $sTextoCopiado = ClipGet() ConsoleWrite($sTextoCopiado & @CRLF) ClipPut("") Sleep(1000) EndFunc ;==>_DoSomething PD: If It's not what you're trying to do, send me a PM and explain in Spanish It's my native language. PD Spanish: Si no es lo que estas tratando de hacer enviame un mensaje privado en Español. Es mi lenguaje nativo. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
stiv Posted September 23, 2021 Author Share Posted September 23, 2021 (edited) Hola Dany, No, básicamente lo que quiero es que la variable que yo guarde con ClipGet, la pueda comparar con una variable igual en una columna excel donde debe estar ese mismo valor. Trans: No, basically what I want is that the variable that I save with ClipGet, I can compare it with an equal variable in an excel column where that same value must be. Edited September 23, 2021 by Melba23 Translation added Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 23, 2021 Moderators Share Posted September 23, 2021 stiv, I told you above that this is an English speaking forum - please stop posting in Spanish or you may find you cannot post at all. M23 stiv 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Musashi Posted September 23, 2021 Share Posted September 23, 2021 (edited) @stiv : Since you are a new member, you may be unfamiliar with what is meant by PM. PM (abbreviation for Personal or Private Message) is a feature of the forum to have a private conversation with one (or more) members. Such a conversation, as the name already indicates, does not appear as a public post, and there you can use whatever language you prefer. To start a private conversation, use the "Envelope Button" from the website header : However, you should consider the following excerpt from the forum rules : Quote 5. Do not PM other users asking for support - that is why the forum exists, so post there instead. On 9/17/2021 at 4:11 AM, Danyfirex said: If It's not what you're trying to do, send me a PM and explain in Spanish It's my native language. In this case it is fine, because @Danyfirex was so kind to offer you additional help. EDIT : A good translation tool for your future contributions can be found e.g. here : https://www.deepl.com/translate Edited September 23, 2021 by Musashi stiv and Danyfirex 1 1 "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
Skysnake Posted September 28, 2021 Share Posted September 28, 2021 On 9/23/2021 at 3:44 PM, stiv said: compare it with an equal variable in an excel column where that same value must be. Hi @stiv you need to do two things. First copy the data. 2nd compare. I don't know what your data look like. A simple Excel VLOOKUP should do what you want. The alternative is always SQL and do a SELECT there. S Skysnake Why is the snake in the sky? Link to comment Share on other sites More sharing options...
stiv Posted September 28, 2021 Author Share Posted September 28, 2021 Hi there. @Skysnake Of course, I did, as a solution, was to filter the excel file (column), and perform a copy and paste process in another row so that I took the initial variables. however it is more process. func pasar() Global $oExcel = _Excel_Open() Global $oWorkbook = _Excel_BookOpen($oExcel, ".\probar.xlsx" ) Sleep(5000) ;---------------recort func------------ WinWaitActive("Microsoft Excel - probar") Send("{CTRLDOWN}{HOME}{CTRLUP}") ;casilla principal Sleep(3000) send("{TAB 5}") Send("{ALTDOWN}{DOWN}{ALTUP}") send("{TAB 7}") Sleep(3000) Send("^v") ;Pega la variable Send ("{ENTER}") Sleep(9000) Local $aResult = _Excel_RangeRead($oWorkbook, Default, "G2") Local $sData = ClipGet() ; Cluck Obtiene la variable ;ClipPut($sResult) $sData = ClipGet() ; Envia La variable obtenida Sleep(3000) ; tiempo Send("^C") ; Pega la variable $Copy = ClipGet() ; WinActivate("Reserva de Citas ") MouseClick("left",893,50,2) If StringInstr ($Copy,"confirmacion",0) then ;Cuando el archivo excel termine su recorrido, realiza una validacion de la casilla G para dar por terminado el robot WinActivate("Reserva de Citas ") Sleep(2000) ;Correo() EndIf EndFunc Link to comment Share on other sites More sharing options...
Skysnake Posted September 28, 2021 Share Posted September 28, 2021 I think you are making this more complicated than it really is. You have data. Where does it originate? Is it a one time or repetitive event? This needs to be read This data needs to placed somewhere, where it can be manipulated. Excel, CSV, or memory Array Once the data store has been selected, use the appropriate tool to find matched. I would write the data to disk. SQLite or CSV so that it is available for inspection and troubleshooting I would loop the data through an array, because it probably is faster and more versatile that Excel. If your SQL is OKish, then simply running repeat SELECT loops on the data may also work See this Comparing Arrays Skysnake Why is the snake in the sky? 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