psychoblast Posted March 27, 2012 Share Posted March 27, 2012 Sorry i am not very familiar with autoit syntax and help files dont help much. What I want to do is have an if loop. If a certain form exists (in IE) then call a certain function or do a certain operation. Is there an IE function to see if a certain form exists? Thanks in advance Link to comment Share on other sites More sharing options...
JohnOne Posted March 27, 2012 Share Posted March 27, 2012 I'm not sure about _IE* functions, but there probably is Mybe_IEPropertyGet But WinExists native function will certainly do that job Few things to note I'm not sure it's appropriate to label your topic as "Easy" if you don't know how to do it. The help files do help, and very much. Your topic is not really about and "if loop" AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
psychoblast Posted March 27, 2012 Author Share Posted March 27, 2012 well my bad it might not be easy :/ but the concept is. Here is what i have so far. however it gives me syntax error. $oValue = _IEFormElementGetValue(ByRef $oFormR) If $oValue > 0 Then _Main() Func _Main() Sleep (7000) Local $hBitmap, $hClone, $hImage, $iX, $iY ; Initialize GDI+ library _GDIPlus_Startup() ; Capture 32 bit bitmap $hBitmap = _ScreenCapture_Capture("") $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap) ; Create 24 bit bitmap clone $iX = 200 $iY = 70 $hClone = _GDIPlus_BitmapCloneArea($hImage, 248, 602, $iX, $iY, $GDIP_PXF24RGB) ; Save bitmap to file _GDIPlus_ImageSaveToFile($hClone, @DesktopDir & "GDIPlus_Image.bmp") ; Clean up resources _GDIPlus_ImageDispose($hClone) _GDIPlus_ImageDispose($hImage) _WinAPI_DeleteObject($hBitmap) ; Shut down GDI+ library _GDIPlus_Shutdown() EndFunc ;==>_Main Sleep (2000) $oFormR=_IEGetObjByName($oIE,"response") _IEAction($oFormR, "focus") _IEFormElementSetValue($oFormR,"Thanks") ElseIf $oValue == 0 Then MsgBox (0,"attention", "no form found") EndIf basically this code does this. if a certain form is found on a page then it does the main function which takes a picture and crops it. However, if IEFormelement returns the value 0 meaning the form was not found i want a message box to appear Link to comment Share on other sites More sharing options...
JohnOne Posted March 27, 2012 Share Posted March 27, 2012 Move the function body outside of your if..elseif..endif condition, below it or above it, it does not matter. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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