This topic is now closed to further replies.
New Guy here. This is a two-part question, hopefully easy enough though. I know it's ugly coding, this is because I have only a couple hours worth of coding experience and could really use some help.
1) When I single click the button I want one action (like playing a sound clip) and when I double click the button I want a different action (such as opening dialogue box to ask for soundclip directory address). At the bottom of the script I made a comment which one I would like single click versus double click.
2) I can not get the FileOpenDialogue to save the file address to the config.ini file at the 'One' position on the .ini.
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <FileConstants.au3> #include <AutoItConstants.au3> #include <Sound.au3> Opt('MustDeclareVars', 1) Opt("GUIOnEventMode", 1) Global $OneID _Main() Func _Main() GUICreate("Form1", 156, 86, 281, 276) $OneID = GUICtrlCreateButton("Button", 15, 17, 122, 37) GUICtrlSetOnEvent($OneID, "OnOne") GUISetOnEvent($GUI_EVENT_CLOSE, "OnExit") GUISetState() While 1 While 1 Sleep(1000) WEnd WEnd EndFunc ;---------------Functions------------- While 1 Sleep(100) WEnd Func OnOne() ; ******************Single Click for this action**************** $OneID = IniRead("config.ini", "Config", "One", $OneID) If $OneID = True Then SoundPlay($OneID, @HotKeyPressed) Else ; *******Double Click for this action*****And Help Saving File Address to config.ini 'One'*********** $OneID = FileOpenDialog("Select file", @WorkingDir, "All (*.*)") IniWrite("config.ini", "Config", "One", $OneID) $OneID = InputBox("Enter Information", "Short Name for File?", "") IniWrite("config.ini", "Config", "NameOne", $OneID) EndIf EndFunc Any help would be greatly appreciated, and if you need anymore clarity as to what exactly I'm trying to do, please do not hesitate to ask. Thanks so much!
I'm trying to move unread mails from Inbox to a different folder using OutlookEx UDF.
But its not working for me. I'm not sure what mistake I do.
I get the error code 6 when the following is executed. From the UDF it is observed that "No or an invalid item has been specified".
Note : The UDF version is 220.127.116.11. AutoIt version (v18.104.22.168).
#include <OutlookEX.au3> Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) Global $aOL_Item = _OL_ItemFind($oOutlook, "*\Inbox", $olMail, "[UnRead]=True", "", "", "Subject", "", 1) If $aOL_Item = 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemMove Example Script", "Could not find a task item in folder 'Outlook-UDF-Test\SourceFolder\Tasks'. @error = " & @error) _ArrayDisplay($aOL_Item, "OutlookEX UDF: _OL_ItemFind Example Script - Unread mails") _OL_ItemMove($oOutlook, $aOL_Item, Default, "*\Outlook-UDF-Test\TargetFolder\Mail") If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemMove Example Script", "Error moving specified task. @error = " & @error) Any help is deeply appreciated. Thanks in advance.
Thanks and regards,
I have a button where I need to close it!
I was doing through clicking same position in screen but there are some id's that have different sizes.
What are the possible ways to click this closable button?
Is there a way to close it through id? Is there a way to get it's position through it's ID?
Thanks in advance!
I'm trying to click a button on a web page. I have added a couple of MsgBox lines to allow me to watch what happens on the page. As you can see the first half of my script enters data into text boxes on the page. I have no problem there. I just cannot click on the region buttons. The "set focus" line causes an outline to appear around the EU button and the "click button" line causes the "Pick a Region" text to disappear. Here is the code I have so far.
#include <IE.au3> Local $oIE = _IECreate("http://questchecker.com/") Local $iQuestID = "123456" Local $sCharacterName = "CharacterName" Local $colForms = _IEFormGetCollection($oIE) $iCount = 0 For $oForm In $colForms $oFormElements = _IEFormElementGetCollection($oForm) For $oFormElement In $oFormElements $iCount = $iCount + 1 Local $sTagName = StringLower($oFormElement.tagName) Local $sElementType = $oFormElement.type Local $sElementName = $oFormElement.name Switch $iCount Case 6 _IEFormElementSetValue($oFormElement, "MyRealm", 0) ; realm Case 7 _IEFormElementSetValue($oFormElement, $sCharacterName, 0) Case 8 _IEFormElementSetValue($oFormElement, $iQuestID, 0) EndSwitch Next Next Local $oButtons = _IEGetObjByName($oIE, "questForm") For $oButton In $oButtons If _IEFormElementGetValue($oButton) = "US" Then MsgBox(0, "", "Click Okay to set focus") _IEAction($oButton, "focus") MsgBox(0, "", "Click Okay to click button") _IEAction($oButton, "click") ExitLoop EndIf Next MsgBox(0, "", "Click Okay to quit") _IEQuit($oIE) Exit
Perform a simple google search!
The script below works fine until fill the google form!
What I can't find is how to submit the form, tried a couple of ways and none of them worked.
#include <IE.au3> $oIE = _IECreate ("www.google.com") $o_form = _IEFormGetObjByName ($oIE, "f") $o_login = _IEFormElementGetObjByName ($o_form, "q") $username = "80251369" _IEFormElementSetValue ($o_login, $username) $o_numer = _IEGetObjByName($o_form, "btnK") _IEAction ($o_numer, "click")
The code runs without any problem.
I don't know how to proceed!
Thanks in advance!