Jump to content

exodius

Active Members
  • Posts

    708
  • Joined

  • Last visited

Everything posted by exodius

  1. If you want to make an Open File Dialog window like that, look at FileOpenDialog, if you want something else, please clarify.
  2. If you're trying to avoid opening an IE window... Would you be able to at least save a file to the computer with INetGet and then read it in with _FileReadToArray and then parse it out like I did, or do you need to get the html completely without saving something to the computer? ***Edit - I would also point out that you can have that IE window be hidden if you change the _IECreate to _IECreate ("http://corgano.co.cc/new/", 0, 1), you'd just want to add _IEQuit($oIE) to the end of what I posted so you didn't end up with orphaned iexplore.exe processes.
  3. Assuming that any additional files on that page will follow the same format: #include <Array.au3> #include <IE.au3> $oIE = _IECreate ("http://corgano.co.cc/new/") $sHTML = _IEDocReadHTML ($oIE) $sRegExp = StringRegExp ($sHTML, '(?:\"\>)(.*)(?:\<\/A>)', 3) If @error Then MsgBox (0, "", @error) _ArrayDisplay ($sRegExp) For $x = 1 To UBound($sRegExp)-1 MsgBox (0, "", $sRegExp[$x]) Next
  4. Fair enough, now that I notice that you're mostly not entering text, you should be able to use ControlClick in most of those cases if you can get the control ids (using the AU3Info tool).
  5. Example from the Help File: Run("notepad.exe") WinWait("Untitled -") ControlSetText("Untitled -", "", "Edit1", "New Text Here" ) You can get the name of the controls (usually) by using the AU3Info tool that you'll find under Tools in SciTE.
  6. I see that you've got a lot of Send commands in your different installer scripts, did you try using ControlSetText? The reason why I ask is Send can fail to enter what you want if the computer lags for some reason and/or it can also be interrupted if someone clicks away from the window you're trying to enter things into (or if another window gets focus somehow).
  7. #include <IE.au3> _IEErrorHandlerRegister() ; This is so we can have a quick and easy COM Error Handler $strComputer = "computername" $objSWbemLocator = ObjCreate("WbemScripting.SWbemLocator") $objSWbemServices = $objSWbemLocator.ConnectServer ($strComputer, "root\cimv2", "computer\administrator", "password") $objSWbemServices.Security_.ImpersonationLevel = 3
  8. Or use _ProcessGetName...
  9. Because you're not asking a specific question you get the example from the helpfile for _GuiCtrlDTP_Create. You'll notice that it writes out the selected date to the console. #AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <GuiConstantsEx.au3> #include <GuiDateTimePicker.au3> #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> Opt('MustDeclareVars', 1) $Debug_DTP = False ; Check ClassName being passed to DTP functions, set to True and use a handle to another control to see it work Global $hDTP _Main() Func _Main() Local $hGUI ; Create GUI $hGUI = GUICreate("(UDF Created) DateTimePick Create", 400, 300) $hDTP = _GUICtrlDTP_Create($hGUI, 2, 6, 190) GUISetState() ; Set the display format _GUICtrlDTP_SetFormat($hDTP, "ddd MMM dd, yyyy hh:mm ttt") GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Main Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $iwParam Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $tInfo, $tBuffer, $tBuffer2 $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hDTP Switch $iCode Case $DTN_CLOSEUP ; Sent by a date and time picker (DTP) control when the user closes the drop-down month calendar _DebugPrint("$DTN_CLOSEUP" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; The return value for this notification is not used Case $DTN_DATETIMECHANGE ; Sent by a date and time picker (DTP) control whenever a change occurs $tInfo = DllStructCreate($tagNMDATETIMECHANGE, $ilParam) _DebugPrint("$DTN_DATETIMECHANGE" & @LF & "--> hWndFrom:" & @TAB & DllStructGetData($tInfo, "hWndFrom") & @LF & _ "-->IDFrom:" & @TAB & DllStructGetData($tInfo, "IDFrom") & @LF & _ "-->Code:" & @TAB & DllStructGetData($tInfo, "Code") & @LF & _ "-->Flag:" & @TAB & DllStructGetData($tInfo, "Flag") & @LF & _ "-->Year:" & @TAB & DllStructGetData($tInfo, "Year") & @LF & _ "-->Month:" & @TAB & DllStructGetData($tInfo, "Month") & @LF & _ "-->DOW:" & @TAB & DllStructGetData($tInfo, "DOW") & @LF & _ "-->Day:" & @TAB & DllStructGetData($tInfo, "Day") & @LF & _ "-->Hour:" & @TAB & DllStructGetData($tInfo, "Hour") & @LF & _ "-->Minute:" & @TAB & DllStructGetData($tInfo, "Minute") & @LF & _ "-->Second:" & @TAB & DllStructGetData($tInfo, "Second") & @LF & _ "-->MSecond:" & @TAB & DllStructGetData($tInfo, "MSecond")) Return 0 Case $DTN_DROPDOWN ; Sent by a date and time picker (DTP) control when the user activates the drop-down month calendar _DebugPrint("$DTN_DROPDOWN" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; The return value for this notification is not used Case $DTN_FORMAT ; Sent by a date and time picker (DTP) control to request text to be displayed in a callback field $tInfo = DllStructCreate($tagNMDATETIMEFORMAT, $ilParam) $tBuffer = DllStructCreate("char Format[128]", DllStructGetData($tInfo, "Format")) $tBuffer2 = DllStructCreate("char Display[64]", DllStructGetData($tInfo, "pDisplay")) _DebugPrint("$DTN_FORMAT" & @LF & "--> hWndFrom:" & @TAB & DllStructGetData($tInfo, "hWndFrom") & @LF & _ "-->IDFrom:" & @TAB & DllStructGetData($tInfo, "IDFrom") & @LF & _ "-->Code:" & @TAB & DllStructGetData($tInfo, "Code") & @LF & _ "-->Format:" & @TAB & DllStructGetData($tBuffer, "Format") & @LF & _ "-->Year:" & @TAB & DllStructGetData($tInfo, "Year") & @LF & _ "-->Month:" & @TAB & DllStructGetData($tInfo, "Month") & @LF & _ "-->DOW:" & @TAB & DllStructGetData($tInfo, "DOW") & @LF & _ "-->Day:" & @TAB & DllStructGetData($tInfo, "Day") & @LF & _ "-->Hour:" & @TAB & DllStructGetData($tInfo, "Hour") & @LF & _ "-->Minute:" & @TAB & DllStructGetData($tInfo, "Minute") & @LF & _ "-->Second:" & @TAB & DllStructGetData($tInfo, "Second") & @LF & _ "-->MSecond:" & @TAB & DllStructGetData($tInfo, "MSecond") & @LF & _ "-->Display:" & @TAB & DllStructGetData($tBuffer2, "Display")) Return 0 Case $DTN_FORMATQUERY ; Sent by a date and time picker (DTP) control to retrieve the maximum allowable size of the string that will be displayed in a callback field $tInfo = DllStructCreate($tagNMDATETIMEFORMATQUERY, $ilParam) $tBuffer = DllStructCreate("char Format[128]", DllStructGetData($tInfo, "Format")) _DebugPrint("$DTN_FORMATQUERY" & @LF & "--> hWndFrom:" & @TAB & DllStructGetData($tInfo, "hWndFrom") & @LF & _ "-->IDFrom:" & @TAB & DllStructGetData($tInfo, "IDFrom") & @LF & _ "-->Code:" & @TAB & DllStructGetData($tInfo, "Code") & @LF & _ "-->Format:" & @TAB & DllStructGetData($tBuffer, "Format") & @LF & _ "-->SizeX:" & @TAB & DllStructGetData($tInfo, "SizeX") & @LF & _ "-->SizeY:" & @TAB & DllStructGetData($tBuffer2, "SizeY")) DllStructSetData($tInfo, "SizeX", 64) DllStructSetData($tInfo, "SizeY", 10) Return 0 Case $DTN_USERSTRING ; Sent by a date and time picker (DTP) control when a user finishes editing a string in the control $tInfo = DllStructCreate($tagNMDATETIMESTRING, $ilParam) $tBuffer = DllStructCreate("char UserString[128]", DllStructGetData($tInfo, "UserString")) _DebugPrint("$DTN_USERSTRING" & @LF & "--> hWndFrom:" & @TAB & DllStructGetData($tInfo, "hWndFrom") & @LF & _ "-->IDFrom:" & @TAB & DllStructGetData($tInfo, "IDFrom") & @LF & _ "-->Code:" & @TAB & DllStructGetData($tInfo, "Code") & @LF & _ "-->UserString:" & @TAB & DllStructGetData($tBuffer, "UserString") & @LF & _ "-->Year:" & @TAB & DllStructGetData($tInfo, "Year") & @LF & _ "-->Month:" & @TAB & DllStructGetData($tInfo, "Month") & @LF & _ "-->DOW:" & @TAB & DllStructGetData($tInfo, "DOW") & @LF & _ "-->Day:" & @TAB & DllStructGetData($tInfo, "Day") & @LF & _ "-->Hour:" & @TAB & DllStructGetData($tInfo, "Hour") & @LF & _ "-->Minute:" & @TAB & DllStructGetData($tInfo, "Minute") & @LF & _ "-->Second:" & @TAB & DllStructGetData($tInfo, "Second") & @LF & _ "-->MSecond:" & @TAB & DllStructGetData($tInfo, "MSecond") & @LF & _ "-->Flags:" & @TAB & DllStructGetData($tInfo, "Flags")) Return 0 Case $DTN_WMKEYDOWN ; Sent by a date and time picker (DTP) control when the user types in a callback field $tInfo = DllStructCreate($tagNMDATETIMEFORMATQUERY, $ilParam) $tBuffer = DllStructCreate("char Format[128]", DllStructGetData($tInfo, "Format")) _DebugPrint("$DTN_WMKEYDOWN" & @LF & "--> hWndFrom:" & @TAB & DllStructGetData($tInfo, "hWndFrom") & @LF & _ "-->IDFrom:" & @TAB & DllStructGetData($tInfo, "IDFrom") & @LF & _ "-->Code:" & @TAB & DllStructGetData($tInfo, "Code") & @LF & _ "-->VirtKey:" & @TAB & DllStructGetData($tInfo, "VirtKey") & @LF & _ "-->Format:" & @TAB & DllStructGetData($tBuffer, "Format") & @LF & _ "-->Year:" & @TAB & DllStructGetData($tInfo, "Year") & @LF & _ "-->Month:" & @TAB & DllStructGetData($tInfo, "Month") & @LF & _ "-->DOW:" & @TAB & DllStructGetData($tInfo, "DOW") & @LF & _ "-->Day:" & @TAB & DllStructGetData($tInfo, "Day") & @LF & _ "-->Hour:" & @TAB & DllStructGetData($tInfo, "Hour") & @LF & _ "-->Minute:" & @TAB & DllStructGetData($tInfo, "Minute") & @LF & _ "-->Second:" & @TAB & DllStructGetData($tInfo, "Second") & @LF & _ "-->MSecond:" & @TAB & DllStructGetData($tInfo, "MSecond")) Return 0 EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func _DebugPrint($s_text, $line = @ScriptLineNumber) ConsoleWrite( _ "!===========================================================" & @LF & _ "+======================================================" & @LF & _ "-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _ "+======================================================" & @LF) EndFunc ;==>_DebugPrint
  10. You'll find the answer you seek in the Help File --> Contents Tab --> GUI Reference --> GUI OnEvent Mode Hopefully you're not too far along in your GUI creation as to make this work you'll need to basically go back and redo how things are handled...
  11. Is that your whole script? Post the rest of it, I see you have a Wend in there, which would make the placement of this For...Next loop kinda important.
  12. So you do realize that what you posted is going to get all of the listview items, not just the ones that are selected right? Oh, and your function to delete selected items is: _GUICtrlListView_DeleteItemsSelected($listeCibles
  13. Try this: ;--------------------------------------------------------- ;Add the files to the .ini file ;--------------------------------------------------------- func addFilesList() $configFile = @ScriptDir & "\config.ini" $sText = "" $lviewSelected = _GUICtrlListView_GetSelectedIndices($listeCibles, 1) For $x = 1 To $lviewSelected[0] $sText &= _GUICtrlListView_GetItemText($listeCibles, $lviewSelected[$x]) & @LF Next IniWriteSection($configFile,"FilesToCopy",$sText) EndFunc **Edit - After looking at it a little closer, I don't think you're using IniWriteSection correctly, the helpfile gives this as an example for how your $sText should be formatted: ; Demonstrate creating a new section using a string as input. $sData = "Key1=Value1" & @LF & "Key2=Value2" & @LF & "Key3=Value3" IniWriteSection($sIni, "Section1", $sData) You're getting the value and you're getting the delimiting @LF in there, but based off your example you don't specify any "Key#="-type of reference.
  14. Your crazy 59.9 minute sleep time didn't work out as easily for an example, so I bumped it up to an even 60 minutes: For $x = 3600000 To 1 Step -1 ToolTip ("Sleeping for " & Int ($x/60000) & " more minutes", 0, 0) MouseClick ("left") Sleep(1000) Next
  15. If you don't have the .csv file in the same folder as the script, yes, give it the full path to it. Here's a version with a little error-checking: #include <Array.au3> #include <File.au3> Dim $array _FileReadToArray ("reports.csv", $array) If Not @error Then _ArrayDisplay ($array) For $x = 1 to $array[0] $split = StringSplit ($array[$x], ",") _ArrayDisplay ($split) Next Else Switch @error Case 1 MsgBox (0, "Can't Open Specified File", "_FileReadToArray couldn't open your file") Case 2 MsgBox (0, "Can't Split File", "_FileReadToArray couldn't split your file") EndSwitch EndIf
  16. Did you save the .xls file as a .csv file?
  17. So.. the first example or the second example? (Hopefully not both)
  18. What code did you actually use?
  19. In SciTE --> Tools --> Compile --> Tidy tab: Possible Parameters: /tc n : 0=Tab >0=Number of Spaces. /gd : Generate documentation file. /rel : Remove empty lines from the source. /sci 0 : Default Minimal output to the console: warning and errors. /sci 1 : Show more progress information. /sci 9 : Show all debug lines as found in the Obfuscator.log. /gds : Show generated doc file in Notepad. /sdp x : Specify Diffprogram to use eg: /sdp C:\Progra~1\WinMerge\winmerge.exe "%new%" "%old%" /nsdp : Don't run program as specified by /sdp. /kv n : n = number of backcopies to keep. 0 = all /bdir x: x = Target backup directory. /sf : Sort all Func-Endfunc Blocks in sequence FuncName. When #Region-#EndRegion is used sort them within that scope. /sfc : Same as /sf but first sorts on Comment at the end of the Func() statement
  20. Yes, it's possible, but this is a support forum, not a requests forum. Welcome to the forums, feel free to give what you're proposing a try and post what you come up with.
  21. The short answer is no, there isn't. The way that IE.au3 works doesn't need to move the mouse to click on links and do different things, so it's not an option you can just turn on. If you want to move your mouse to different places on the screen, just use MouseMove or MouseClick.
  22. The IE.au3 functions are intended to work directly with Internet Explorer via its API, which is why the mouse doesn't move... If you want to move the mouse around for some reason, look at MouseMove?
  23. For the benefit of those of us who don't know how this program works, is it a thick-client? (ie installed program) Is it a web-application? How do you normally keep it active? If it's a web application have you tried automating it with the _IE* functions? More details in your initial post will help get a suggestion quicker, and keep me from rescuing you from the bottom of the 2nd page.
  24. My best guess is you may find something of value in the Developer Guide from their website... I don't use/have never used it, but it looks like a proprietary control-sort of operation that's going to be difficult for AutoIt to read directly with it's built-in control-reading functions... Good luck! **Edit - Oh, and by the way, don't double-post if no one replies to your original post, wait 24 hours and then you can reply to your own message with a simple **bump** as the text...
  25. Have you tried anything yet? I guess I see this going one of two ways, although both ways basically end up the same... You can either use the _Excel* functions that come with AutoIt and loop through every line and write out whatever you want to write out like this: #include <Excel.au3> #include <Array.au3> $oExcel = _ExcelBookOpen(@ScriptDir & "\reports.xls") $aData = _ExcelReadSheetToArray ($oExcel) _ArrayDisplay($aData)**Warning! This will probably take a long time to run because your .xls file is so big!!** On my relatively beefy computer, it took 10 minutes to read in your Excel doc, and then about 20 seconds to do the _ArrayDisplay Or you can save your .xls file as a .csv file, use _FileReadToArray, then split each line by a comma using StringSplit and loop through every line and write out whatever you want to write out like this: #include <Array.au3> #include <File.au3> Dim $array _FileReadToArray ("reports.csv", $array) _ArrayDisplay ($array) For $x = 1 to $array[0] $split = StringSplit ($array[$x], ",") _ArrayDisplay ($split) NextThis is considerably quicker.
×
×
  • Create New...