Jump to content

Finding a word?


olo
 Share

Recommended Posts

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 by olo
Link to comment
Share on other sites

Hey can someone help me with this.

  • I want to find +7V using ctrl+f
  • then 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 +7V

if true ....do something...

else ....

endif

;+7V
Global $para1 = Send("{CTRLDOWN}f{CTRLUP}{+}7V")
if $para1 = 1 Then
Link to comment
Share on other sites

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 by FireFox
Link to comment
Share on other sites

  • Moderators

olo,

Topics merged. Just one at a time in future please. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 by FireFox
Link to comment
Share on other sites

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

#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 ? :)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...