Leaderboard
Popular Content
Showing content with the highest reputation on 06/26/2013 in all areas
-
here we go...just grabbing the LAST one: $oXML = ObjCreate("Microsoft.XMLDOM") $oXML2 = ObjCreate("Microsoft.XMLDOM") If Not IsObj($oXML) Then MsgBox(0, "", "Unable to create COM session to XML.") Exit EndIf InetGet("http://javadl-esd.sun.com/update/1.7.0/map-m-1.7.0.xml", @DesktopDir & "\xml1.xml") $oXML.Load(@DesktopDir & "\xml1.xml") ; used when loading a downloaded file $oLastUpdate = $oXML.lastChild.lastChild.selectSingleNode("url") ConsoleWrite($oLastUpdate.text) InetGet($oLastUpdate.text, @DesktopDir & "\xml2.xml") $oXML2.Load(@DesktopDir & "\xml2.xml") ; used when loading a downloaded file ;~ ConsoleWrite($oXML.xML) For $oParent In $oXML2.selectNodes( '//information[@xml:lang="en"]' ) $sLanguage = $oParent.getAttribute("xml:lang") $oChild = $oParent.selectSingleNode('./version') If IsObj($oChild) Then $sVersionText = $oChild.Text ConsoleWrite("Language=[" & $sLanguage & "]...Version=[" & $sVersionText & "]" & @crlf) Else ConsoleWrite("Language=[" & $sLanguage & "]...No version" & @CRLF) EndIf Next ConsoleWrite($sVersionText & @CRLF) This is a sure thing...who knows when they will change the version text structure...this is blind to that structure (as long as they don't update the xml ) output (didn't include a @crlf on the first consolewrite): https://javadl-esd-secure.oracle.com/update/1.7.0/au-descriptor-1.7.0_25-b17.xmlLanguage=[en]...Version=[1.7.0_25-b17] 1.7.0_25-b17 edit: and oh, you asked the question fine, I'm a serial "not read the full question" kind of guy...I just see what I like, and run with it1 point
-
1 point
-
hey! I just answered an xml question...modified for your cause: $oXML = ObjCreate("Microsoft.XMLDOM") If Not IsObj($oXML) Then MsgBox(0, "", "Unable to create COM session to XML.") Exit EndIf ;~ $oXML.Load(@DesktopDir & "\xml.xml") ; used when loading a downloaded file $oXML.loadxml($your_variable_with_xml_text) ; used when loading a string ;~ ConsoleWrite($oXML.xML) $oVersion = $oXML.selectSingleNode( '//version' ) ConsoleWrite($oVersion.text & @CRLF)1 point
-
Suggestions needed for a function
DW1 reacted to JLogan3o13 for a topic
Three working answers in less than two minutes, what other forum can say that!1 point -
How do i grey out checkboxes ?
BlackBerryx3 reacted to FireFox for a topic
Hi, You need to change the state of your checkbox with the GUICtrlSetState function. #include <GUIConstantsEx.au3> ... GUICtrlSetState($checkbox1, $GUI_DISABLED)It seems like the purpose of your script breaks the forum rules (no game automation here) but you're not asking help for this so you're lucky Br, FireFox.1 point -
List all open file handles
iamtheky reacted to AdmiralAlkex for a topic
Have you tried Process Monitor? It allows you to see writes, flushes and all that.1 point -
This is the modified _OL_ItemFind function: ; #FUNCTION# ==================================================================================================================== ; Name ..........: _OL_ItemFind ; Description ...: Finds items (contacts, appointments ...) returning an array of all specified properties. ; Syntax.........: _OL_ItemFind($oOL, $vFolder[, $iObjectClass = Default[, $sRestrict = ""[, $sSearchName = ""[, $sSearchValue = ""[, $sReturnProperties = ""[, $sSort = ""[, $iFlags = 0[, $sWarningClick = ""]]]]]]]]) ; Parameters ....: $oOL - Outlook object returned by a preceding call to _OL_Open() ; $vFolder - Folder object as returned by _OL_FolderAccess or full name of folder where the search will be started. ; +If you want to search a default folder you have to specify the folder object. ; $iObjectClass - Optional: Class of items to search for. Defined by the Outlook OlObjectClass enumeration (default = Default = $olContact) ; $sRestrict - Optional: Filter text to restrict number of items returned (exact match). For details please see Remarks ; $sSearchName - Optional: Name of the property to search for (without brackets) ; $sSearchValue - Optional: String value of the property to search for (partial match) ; $sReturnProperties - Optional: Comma separated list of properties to return (default = depending on $iObjectClass. Please see Remarks) ; $sSort - Optional: Property to sort the result on plus optional flag to sort descending (default = None). E.g. "[Subject], True" sorts the result descending on the subject ; $iFlags - Optional: Flags to set different processing options. Can be a combination of the following: ; | 1: Subfolders will be included ; | 2: Row 1 contains column headings. Therefore the number of rows/columns in the table has to be calculated using UBound ; | 4: Just return the number of records. You don't get an array, just a single integer denoting the total number of records found ; $sWarningClick - Optional: The entire path (drive, directory, file name and extension) to 'OutlookWarning2.exe' or another exe with the same function (default = None) ; Return values .: Success - One based two-dimensional array with the properties specified by $sReturnProperties ; Failure - Returns "" and sets @error: ; |1 - You have to specifiy $sSearchName AND $sSearchValue or none of them ; |2 - $sWarningClick not found ; |3 - Error accessing the specified folder. See @extended for errorcode returned by _OL_FolderAccess ; |4 - Error accessing specified property. For details check @extended ; |1xx - Error checking $sReturnProperties as returned by __OL_CheckProperties. @extended is the number of the property in error (zero based) ; Author ........: water ; Modified ......: ; Remarks .......: Be sure to specify the values in $sReturnProperties and $sSearchName in correct case e.g. "FirstName" is valid, "Firstname" is invalid ;+ ; $sRestrict: Filter can be a Jet query or a DASL query with the @SQL= prefix. Jet query language syntax: ; Restrict filter: Filter LogicalOperator Filter ... ; LogicalOperator: And, Or, Not. Use ( and ) to change the processing order ; Filter: "[property] operator 'value'" or '[property] operator "value"' ; Operator: <, >, <=, >=, <>, = ; Example: "[Start]='2011-02-21 08:00' And [End]='2011-02-21 10:00' And [Subject]='Test'" ; See: http://msdn.microsoft.com/en-us/library/cc513841.aspx - "Searching Outlook Data" ; http://msdn.microsoft.com/en-us/library/bb220369(v=office.12).aspx - "Items.Restrict Method" ;+ ; N.B.: Pass time as HH:MM, HH:MM:SS is invalid and returns no result ; Related .......: ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _OL_ItemFind($oOL, $vFolder, $iObjectClass = Default, $sRestrict = "", $sSearchName = "", $sSearchValue = "", $sReturnProperties = "", $sSort = "", $iFlags = 0, $sWarningClick = "") Local $bChecked = False, $oItems, $aTemp, $iCounter = 0, $oItem If $sWarningClick <> "" Then If FileExists($sWarningClick) = 0 Then Return SetError(2, 0, "") Run($sWarningClick) EndIf If $iObjectClass = Default Then $iObjectClass = $olContact ; Set Default ObjectClass ; Set default return properties depending on the class of items If StringStripWS($sReturnProperties, 3) = "" Then Switch $iObjectClass Case $olContact $sReturnProperties = "FirstName,LastName,Email1Address,Email2Address,MobileTelephoneNumber" Case $olDistributionList $sReturnProperties = "Subject,Body,MemberCount" Case $olNote, $olMail $sReturnProperties = "Subject,Body,CreationTime,LastModificationTime,Size" Case Else EndSwitch EndIf If Not IsObj($vFolder) Then $aTemp = _OL_FolderAccess($oOL, $vFolder) If @error Then Return SetError(3, @error, "") $vFolder = $aTemp[1] EndIf If ($sSearchName <> "" And $sSearchValue = "") Or ($sSearchName = "" And $sSearchValue <> "") Then Return SetError(1, 0, "") Local $aReturnProperties = StringSplit(StringStripWS($sReturnProperties, 8), ",") Local $iIndex = $aReturnProperties[0] If $aReturnProperties[0] < 2 Then $iIndex = 2 If StringStripWS($sRestrict, 3) = "" Then $oItems = $vFolder.Items Else $oItems = $vFolder.Items.Restrict($sRestrict) EndIf Local $iItems = $oItems.Count Local $aItems[$iItems + 1][$iIndex] = [[0, $aReturnProperties[0]]] If BitAND($iFlags, 4) <> 4 And $sSort <> "" Then $aTemp = StringSplit($sSort, ",") If $aTemp[0] = 1 Then $oItems.Sort($sSort) Else $oItems.Sort($aTemp[1], True) EndIf EndIf For $i = 1 To $iItems $oItem = $oItems.Item($i) If $oItem.Class <> $iObjectClass Then ContinueLoop ; Get all properties of first item and check for existance and correct case If BitAND($iFlags, 4) <> 4 And Not $bChecked Then If Not __OL_CheckProperties($oItem, $aReturnProperties, 1) Then Return SetError(@error, @extended, "") $bChecked = True EndIf If $sSearchName <> "" And StringInStr($oItem.ItemProperties.Item($sSearchName).value, $sSearchValue) = 0 Then ContinueLoop ; Fill array with the specified properties $iCounter += 1 If BitAND($iFlags, 4) <> 4 Then For $iIndex = 1 To $aReturnProperties[0] $aItems[$iCounter][$iIndex - 1] = $oItem.ItemProperties.Item($aReturnProperties[$iIndex]).value If @error Then Return SetError(4, @error, "") If BitAND($iFlags, 2) = 2 And $iCounter = 1 Then $aItems[0][$iIndex - 1] = $oItem.ItemProperties.Item($aReturnProperties[$iIndex]).name Next EndIf If BitAND($iFlags, 4) <> 4 And BitAND($iFlags, 2) <> 2 Then $aItems[0][0] = $iCounter Next If BitAND($iFlags, 4) = 4 Then ; Process subfolders If BitAND($iFlags, 1) = 1 Then For $vFolder In $vFolder.Folders $iCounter += _OL_ItemFind($oOL, $vFolder, $iObjectClass, $sRestrict, $sSearchName, $sSearchValue, $sReturnProperties, $sSort, $iFlags, $sWarningClick) Next EndIf Return $iCounter Else ReDim $aItems[$iCounter + 1][$aReturnProperties[0]] ; Process subfolders If BitAND($iFlags, 1) = 1 Then For $vFolder In $vFolder.Folders $aTemp = _OL_ItemFind($oOL, $vFolder, $iObjectClass, $sRestrict, $sSearchName, $sSearchValue, $sReturnProperties, $sSort, $iFlags, $sWarningClick) __OL_ArrayConcatenate($aItems, $aTemp, $iFlags) Next EndIf Return $aItems EndIf EndFunc ;==>_OL_ItemFind I hope it solves your problem.1 point
-
When compiled, how to know which line is error
michaelslamet reacted to nitekram for a topic
Not sure if you have tried this, but it got me going on the right track1 point -
When compiled, how to know which line is error
michaelslamet reacted to Jos for a topic
You need to also use the EXE generated when using these parameters or simply use obfuscator option /mo or /mergeonly, in stead of /so, which will produce the same script as used by aut2exe. Jos1 point -
Missed your last post #9. One way, that I sometimes use, is to have certain values and returns, saved to a log file, that you can check if need be ... which can even be a ini file if desired. This method is especially useful where dialogs or SciTE is not helpful, etc.1 point
-
$timer = TimerInit() For $i = 1 To 100000 _a() Next ConsoleWrite(TimerDiff($timer) & @CRLF) Global $c, $d $timer = TimerInit() For $i = 1 To 100000 _b() Next ConsoleWrite(TimerDiff($timer) & @CRLF) Func _a() $a = 1 $b = 2 Return $a + $b EndFunc ;==>_a Func _b() $c = 1 $d = 2 Return $c + $d EndFunc ;==>_b1 point
-
myspacee, Just remove all non-digits: $mytxt = "Where have all the flowers gone, long time p33 976 7 6761assing? E#a%t^ m(y) {sh}o=rts" MsgBox(0, "Regular Expression Replace Test", StringRegExpReplace($mytxt, "[^[:digit:]]", "")) M231 point