Sign in to follow this  
Followers 0
olo

Finding a word?

9 posts in this topic

#1 ·  Posted (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 by olo

Share this post


Link to post
Share on other sites



and if it displays the error msgbox I then go on to call another func.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by FireFox
1 person likes this

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

olo,

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

M23

1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (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 by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
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

Share this post


Link to post
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 ? :)

1 person likes this

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0