olo Posted April 16, 2013 Share Posted April 16, 2013 (edited) Hey I need help trying to carry out the following. N.B. Problem is if I change the $para1 = 0 it will display the error message but the +5V might be there in the document. So I think its with the global $para1 statement. I want to ctrl+f +5V if found do something. else display msgbox error. Func row1() ;+5V Global $para1 = Send("{CTRLDOWN}f{CTRLUP}{+}5V") if $para1 = 1 Then MouseClickDrag ( "LEFT", MouseGetPos(0), MouseGetPos(1), MouseGetPos(0) + $xdist , MouseGetPos(1) + $ydist) Send("{CTRLDOWN}c{CTRLUP}") Send("{CTRLDOWN}c{CTRLUP}") Global $sContent1 = ClipGet() ClipPut($sContent1) ClipPut("") Else MsgBox(0,"Error", "No +5V parameter found!", 3) Endif EndFunc Edited April 16, 2013 by olo Link to comment Share on other sites More sharing options...
olo Posted April 16, 2013 Author Share Posted April 16, 2013 and if it displays the error msgbox I then go on to call another func. Link to comment Share on other sites More sharing options...
olo Posted April 16, 2013 Author Share Posted April 16, 2013 Hey can someone help me with this.I want to find +7V using ctrl+fthen if thats true do something...else do something else.However when I replace the if $para1 = 0 Then if doesnt work at all even if there is a +7V present.Anyway to say ctrl+f +7Vif true ....do something...else ....endif;+7V Global $para1 = Send("{CTRLDOWN}f{CTRLUP}{+}7V") if $para1 = 1 Then Link to comment Share on other sites More sharing options...
olo Posted April 16, 2013 Author Share Posted April 16, 2013 Please stick to only one thread.sorry firefox tried to delete the other one to make this a bit simpler cause I wasnt getting any replies. Link to comment Share on other sites More sharing options...
FireFox Posted April 16, 2013 Share Posted April 16, 2013 (edited) You have an edit button for that. Note that it's NOT a 24/24 support forum and furthermore you have to wait 1 day before bumping your topics. Please do not reply to this, I will answer to the other topic. Edited April 16, 2013 by FireFox olo 1 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 16, 2013 Moderators Share Posted April 16, 2013 olo, Topics merged. Just one at a time in future please. M23 olo 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...
FireFox Posted April 16, 2013 Share Posted April 16, 2013 (edited) Try this in the Google Chrome browser : #include <Constants.au3> Local $sSearch = "+5v" Local $hWnd = WinGetHandle("Title") ;window title WinActivate($hWnd) WinWaitActive($hWnd) Send("^f") Send($sSearch, 1) Send("{ENTER}") ;starts the search, will point to the first text found Local $aPos = WinGetPos($hWnd) MouseClick("right", $aPos[0] + 15, $aPos[1] + 120, 1, 0) ClipPut("") ;if nothing is found the clipboard content is not changed Send("{DOWN 3}{ENTER}") Local $sContent1 = ClipGet() If $sContent1 <> $sSearch Then MsgBox($MB_APPLMODAL, "", "Nothing found.") Else MsgBox($MB_APPLMODAL, "", "Found.") EndIf Br, FireFox. Edited April 16, 2013 by FireFox Link to comment Share on other sites More sharing options...
olo Posted April 16, 2013 Author Share Posted April 16, 2013 Try this in the Google Chrome browser : #include <Constants.au3> Local $sSearch = "+5v" Local $hWnd = WinGetHandle("Title") ;window title WinActivate($hWnd) WinWaitActive($hWnd) Send("^f") Send($sSearch, 1) Send("{ENTER}") ;starts the search, will point to the first text found Local $aPos = WinGetPos($hWnd) MouseClick("right", $aPos[0] + 15, $aPos[1] + 120, 1, 0) ClipPut("") ;if nothing is found the clipboard content is not changed Send("{DOWN 3}{ENTER}") Local $sContent1 = ClipGet() If $sContent1 <> $sSearch Then MsgBox($MB_APPLMODAL, "", "Nothing found.") Else MsgBox($MB_APPLMODAL, "", "Found.") EndIf Br, FireFox. could you explain it a bit. Im finding it a bit hard to follow. thanks again Link to comment Share on other sites More sharing options...
FireFox Posted April 16, 2013 Share Posted April 16, 2013 #include <Constants.au3> Local $sSearch = "+5v" ;search words ;retrieves the browser window handle Local $hWnd = WinGetHandle("Title") ;window title WinActivate($hWnd) WinWaitActive($hWnd) Send("^f") ;opens the search input Send($sSearch, 1) ;writes the search Send("{ENTER}") ;starts the search, will point to the first text found Local $aPos = WinGetPos($hWnd) ;get the browser wnd pos MouseClick("right", $aPos[0] + 15, $aPos[1] + 120, 1, 0) ;right click on the pdf ClipPut("") ;if nothing is found the clipboard content is not changed (so we clear it) Send("{DOWN 3}{ENTER}") ;select the "Copy" menu item Local $sContent1 = ClipGet() ;content copied If $sContent1 <> $sSearch Then ;if the content copied is different from the search MsgBox($MB_APPLMODAL, "", "Nothing found.") Else MsgBox($MB_APPLMODAL, "", "Found.") EndIf Better ? olo 1 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