Jump to content

Stilgar

Active Members
  • Posts

    422
  • Joined

  • Last visited

3 Followers

Profile Information

  • WWW
    http://thorsten-willert.de

Recent Profile Visitors

959 profile views

Stilgar's Achievements

Universalist

Universalist (7/7)

13

Reputation

  1. Hi, you can take a look at my UDF for Planmaker: PlanMaker-UDF I think you can rebuild something for TextMaker. e.g. _PlanMaker_BookAttach _PlanMaker_BookSaveAs greetings Stilgar
  2. Sorry for the long downtime. Can anyone tell me what's the difference between my current version 0.6.0.2b and all the functions here in the forum?
  3. $iTabIndex = 3 ; the index of your tab $sTextContent = _FFCmd("gBrowser.getBrowserAtIndex(" & $iTabIndex & ").contentDocument.body.textContent", 3000)
  4. _FFClick(_FFXPath("/html/body/div/div/div[2]/div/div[4]/div/div[2]/div/div[2]/div/div/div/div[3]/div/div[2]/div/div[3]/div/div[2]/div/div[5]/table/tbody/tr/td/table/tbody/tr/td[3]/div/div/div/div/div") ) That's all
  5. @ozmike: I've uploaded a corrected version.
  6. _FFFormSubmit() !! without any parameter can't return this error. Have you more of the HTML-source, your script and the output of the console, please?
  7. @mootius: The function _FF_Call is for executing JavaScripts: FFEx.au3 @13lack13lade: You can interact with them e.g. with _FFXpath and _FFClick. Look please on the examples: _FFClick and _FFXpath The XPath can you copy from FireBug.
  8. If you have only one Form on this page: _FFFormSubmit()
  9. AutoIt Version : V3.3.0.0 Two older scripts ... they are not longer supported from me, but if anyone can use it ... _Au3Optim.au3: Optimizes au3-source-code + simple PreProzessor (#define-macros) The steps inside the function: ; merging lines ; merging strings ; caching all strings ; replacing #define directives ; replacing "inline" functions e.G. Func test($a,$b) Return $a*$b EndFunc ; replacing GLOBAL constants ; replace StringFormat ; replace StringLower/Upper/Left/Right/Mid/Len/StripWS/StripCR/TrimLeft|TrimRight|Replace ; replace Math-functions ; replace BitAnd/BitOr ; replace simple calculations ; merging one-line If-block ; removing redunant ElseIf ... Example 1 Input: #define msg(txt) MsgBox(0,"Test",txt) #define msg2(txt,title) MsgBox(0,title,txt) #define $bla "blubber" msg("Hallo") msg('Hallo 2') msg2("Hallo", "Titel") $text = $bla Example 2 Output: MsgBox(0,"Test","Hallo") MsgBox(0,"Test",'Hallo 2') MsgBox(0,"Titel","Hallo") $text = "blubber" Example 2 Input: ; Test.au3 fuer _Au3Optim #define @InetGetActive InetGetInfo() Global const $test=2 ; Test 1 global Const $test2 =4 global const $test3= 8 Global Const $test4 = "das ist ein Test" ; Test 4 global Const $test5 = 'das ist ein anderer Test' $bla1 = $test+ $test2 + $test3 $bla2 = $test4 $bla3 = $test5 DllStructCreate( _ "dword dwsize;" & _ "dword cntUsage;" & _ "dword th32ProcessID;" & _ "uint th32DefaultHeapID;" & _ "dword th32ModuleID;" & _ "dword cntThreads;" & _ "dword th32ParentProcessID;" & _ "long pcPriClassBase;" & _ "dword dwFlags;" & _ "char szExeFile[260]" _ ) $s = @InetGetActive $a7j = _k_() $ms = $s34 *1000*60*$min $t = (3 + 32) * 45 $ms = "1000*60*34" $ms = '1000*60*34' If _Bla() = 0 And $t = 0 or($t = 0) Then $bla = True If $a[0] = False Then $bla = True If @error = 0 Then If $a = 1 Or $t6575 = True Then $bla = True If $a = True Then $bla = True If @error = 1 Then $variable = $variable + 1 $i = $i *10 $s = StringFormat("%s %.2f %s", "test", 4.56345345 , "test") $s = StringFormat("%s %.2f", "test", 4.56345345 * $test2) $s = StringFormat("%s %.2f %s", "Das ist eine Zahl", 4.56345345 , $test20) Msg("Hallo Welt") $c = _F2C($F, 2) $c = _F2C(128, 2) $b1 = _Test0(1, 2) $b2 = _Test0(3, 4) $b3 = Abs(_Test0(5, 6) + 100) $a = 1 _Test1($a, 2) _Test2("Hallo ", "das ist ein ", "Test") ; Test 2 $b = _Test3("text") $c = _Test4(5) ; EndFunc ; ============================================================================== Func _fg($t = 0, $2 = 1) Local $t Return EndFunc Func _k_() Return(@YEAR & "/" & @MON & "/" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC) EndFunc Func _1_() Return "test" EndFunc Func _F2C($F, $iP) Return Round(($F - 32) * 5 / 9, $iP) EndFunc ;==>_F2C Func _Test0($a, $z) Return $z * 3 * $a + 100 EndFunc ;==>_Test0 Func _Test1(ByRef $a, $b) Return ConsoleWrite($a + $b) EndFunc ;==>_Test1 Func _Test2($a, $b, $c) Return ConsoleWrite($a & $b & $c & @CRLF) EndFunc ;==>_Test2 Func _Test3($u) Return $u EndFunc ;==>_Test3 Func _Test4($s) Local $r = $s * 2 Return $r EndFunc ;==>_Test4 Func Msg($s) Return MsgBox(0, "Message:", $s) EndFunc ;==>Msg Example 2 Output: ; Test.au3 fuer _Au3Optim $bla1 = 14 $bla2 = "das ist ein Test" $bla3 = 'das ist ein anderer Test' DllStructCreate( "dword dwsize;dword cntUsage;dword th32ProcessID;uint th32DefaultHeapID;dword th32ModuleID;dword cntThreads;dword th32ParentProcessID;long pcPriClassBase;dword dwFlags;char szExeFile[260]" ) $s = InetGetInfo() $a7j = (@YEAR & "/" & @MON & "/" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC) $ms = $s34 *60000*$min $t = (35) * 45 $ms = "2040000" $ms = '2040000' If Not _Bla() And Not $t or($t = 0) Then $bla = True If Not $a[0] Then $bla = True If Not @error Then If $a Or $t6575 Then $bla = True If $a Then $bla = True If @error Then $variable += 1 $i *= 10 $s = "test 4.56 test" $s = "test 18.25" $s = StringFormat("%s %.2f %s", "Das ist eine Zahl", 4.56345345 , $test20) MsgBox(0, "Message:", "Hallo Welt") $c = Round(($F - 32) * 0.555555555555556, 2) $c = 53.33 $b1 = 106 $b2 = 136 $b3 = Abs(290) $a = 1 ConsoleWrite($a + 2) ConsoleWrite("Hallo das ist ein Test" & @CRLF) ; Test 2 $b = "text" $c = _Test4(5) ; EndFunc ; ============================================================================== Func _fg($t = 0, $2 = 1) Local $t Return EndFunc Func _Test4($s) Local $r = $s * 2 Return $r EndFunc ;==>_Test4 Download: _Au3Optim.au3 _Patch.au3 Some compatibily patches for older scripts (3.3.0.0 => 3.3.2.0) (inlcuded from _Au3Optim if it in the same directory) #region Patches from 3.3.0.0 => 3.3.2.0 #OnAutoItStartRegister "OnAutoItStart" OnAutoItExitRegister("OnAutoItExit") #define @InetGetBytesRead InetGetInfo(Default, 0) #define @InetGetActive (Not InetGetInfo(Default, 2)) ; InetGet("abort") = InetClose($h) ;=============================================================================== Func _SQLite_SaveMode($fSaveModeState) Local $r = _SQLite_SafeMode($fSaveModeState) Return SetError(@error,@extended,$r) EndFunc ;==> ;=============================================================================== Func URLDownloadToFile($sURL, $sFilename, $iReload, $iBackground) ; ??? Return InetGet($sURL, $sFilename, $iReload, $iBackground) EndFunc ;==>URLDownloadToFile ;=============================================================================== Func AdlibEnable($sFunc, $iTime = 250) Return AdlibRegister($sFunc, $sTime) EndFunc ;==>AdlibEnable ;=============================================================================== Func AdlibDisable() Return AdlibUnRegister() EndFunc ;==>AdlibDisable ;=============================================================================== ; #FUNCTION# =================================================================== ; Name...........: _WinAPI_MakeDWord ; Description ...: Returns a DWord value from two int values ; Syntax.........: _WinAPI_MakeDWord($HiWord, $LoWord) ; Parameters ....: $HiWord - Hi word ; $LoWord - Low word ; Return values .: Success - DWord value ; Author ........: Gary Frost (gafrost) ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........; ; Example .......; ; ============================================================================== Func _WinAPI_MakeDWord($HiWord, $LoWord) Return BitOR($LoWord * 0x10000, BitAND($HiWord, 0xFFFF)) EndFunc ;==>_WinAPI_MakeDWord ; #FUNCTION# =================================================================== ; Name...........: _StringAddThousandsSep ; Description ...: Returns the original numbered string with the Thousands delimiter inserted. ; Syntax.........: _StringAddThousandsSep($sString[, $sThousands = -1[, $sDecimal = -1]]) ; Parameters ....: $sString - The string to be converted. ; $sThousands - Optional: The Thousands delimiter ; $sDecimal - Optional: The decimal delimiter ; Return values .: Success - The string with Thousands delimiter added. ; Author ........: SmOke_N (orignal _StringAddComma ; Modified.......: Valik (complete re-write, new function name) ; Remarks .......: ; Related .......: ; Link ..........; ; Example .......; Yes ; ============================================================================== Func _StringAddThousandsSep($sString, $sThousands = -1, $sDecimal = -1) Local $sResult = "" ; Force string Local $rKey = "HKCU\Control Panel\International" If $sDecimal = -1 Then $sDecimal = RegRead($rKey, "sDecimal") If $sThousands = -1 Then $sThousands = RegRead($rKey, "sThousand") ;~ Local $aNumber = StringRegExp($sString, "(\d+)\D?(\d*)", 1) Local $aNumber = StringRegExp($sString, "(\D?\d+)\D?(\d*)", 1) ; This one works for negatives. If UBound($aNumber) = 2 Then Local $sLeft = $aNumber[0] While StringLen($sLeft) $sResult = $sThousands & StringRight($sLeft, 3) & $sResult $sLeft = StringTrimRight($sLeft, 3) WEnd ;~ $sResult = StringTrimLeft($sResult, 1) ; Strip leading thousands separator $sResult = StringTrimLeft($sResult, StringLen($sThousands)) ; Strip leading thousands separator If $aNumber[1] <> "" Then $sResult &= $sDecimal & $aNumber[1] EndIf Return $sResult EndFunc ;==>_StringAddThousandsSep #endregion Patches from 3.3.0.0 => 3.3.2.0
  10. InputBox with multiple inputs. Download: _MultiInput.au3 ; Name ..........: _MultiInput ; Description ...: InputBox with multiple inputs ; AutoIt Version : V3.3.0.0 ; Syntax ........: _MultiInput(ByRef $aText[, $sTitle = ""[, $vInputStyle = -1[, $iInputWidth = 200[, $sButtonR = "OK"[, $sButtonL = "Cancel"[, $iReturnMode = 0]]]]]]) ; Parameter(s): .: $aText - Array with the text for the input-controls. ; * Text-style: ; | **Text** = bold ; | ""Text"" = italic ; | __Text__ = underline ; | --Text-- = strike ; $sTitle - Optional: (Default = "") : Window-title ; $vInputStyle - Optional: (Default = -1) : Style for the input-controls. ; | single var for a global style, or ; | array for different styles ; * lool at the "GUI Control Styles" ; $iInputWidth - Optional: (Default = 200) : Width of the inputs ; $sButtonR - Optional: (Default = "OK") : Text of the right button ; $sButtonL - Optional: (Default = "Cancel") : Text of the left button ; $iReturnMode - Optional: (Default = 0) : ; | 0 Returns a single string, values seperated with the GUIDataSeparatorChar ; | 1 Returns an array with all values ; Return Value ..: Success - string or array, depending on $iReturnMode ; Failure - empty string ; @ERROR - 1 if cancel is pressed ; | 2 UBound($aT) <> UBound($aInputFormat) ; | 3 $aText not an array ; Author(s) .....: Thorsten Willert ; Date ..........: Sun Nov 08 12:25:22 CET 2009 ; Version .......: 3.0 ; Example .......: ; ;Global $aTexts[5] = ["**Verzeichnis**", "Benutzer", "Passwort", "", "__Information__"] ;Global $aInputSt[5] = [-1, -1, 32] ; $ES_PASSWORD = 32 ; Global $sValues = _MultiInput($aTexts, "Test", $aInputSt) ; If Not @error Then MsgBox(0, "", $sValues) _MultiInput(ByRef $aText[, $sTitle = ""[, $vInputStyle = -1[, $iInputWidth = 200[, $sButtonR = "OK"[, $sButtonL = "Cancel"[, $iReturnMode = 0]]]]]] Example: #include <_MultiInput.au3> Global $aTexts[5] = ["**Verzeichnis**", "Benutzer", "Passwort", "", "__Information__"] Global $aInputSt[5] = [-1, -1, 32] ; $ES_PASSWORD = 32 Global $sValues = _MultiInput($aTexts, "Test", $aInputSt) If Not @error Then MsgBox(0, "", $sValues)
  11. A simple function that loads a CSV-file into a 2-dim array: ; Name ..........: _CSV2Array ; Description ...: ; AutoIt Version : V3.3.0.0 ; Syntax ........: _CSV2Array($hFile[, $cSeperator = "auto"[, $bFilterString = True[, $iColumnMode = 0]]]) ; Parameter(s): .: $hFile - Handle for the CSV file to Read ; $cSeperator - Optional: (Default = "auto") : Tries to find the separator char (; or , or TAB or | or space) ; | Data-seperator-char ; | Empty-string = Opt("GUIDataSeparatorChar") ; $bFilterString - Optional: (Default = True) : Removes leading and trailing " or ' ; $iColumnMode - Optional: (Default = 0) : ; | 0: Sets error if lines have different columns and @extended to the csv-line number ; | 1: returns lines with different columns numbers comparing to the first line, too ; | 2: removing all columns > column numbers in the first line ; Return Value ..: Success - 2-dim Array ; Failure - 0 ; @ERROR - 1: error file read ; @ERROR - 2: different number of columns / @EXTENDED = CSV-line ; - 3: parameter error ; Author(s) .....: Thorsten Willert ; Date ..........: Mon Dec 07 18:59:46 CET 2009 _CSV2Array($hFile[, $cSeperator = "auto"[, $bFilterString = True[, $iColumnMode = 0]]]) Download: _CSV2Array.au3
  12. NOT is not an operator, it's a funktion: http://www.w3schools.com/xpath/xpath_functions.asp#boolean This should work: $aName = _FFXpath("//a[contains(@href,'details') and not(contains(@href, 'slow'))]", "href", 6)
  13. I'm waiting for the new interface but it is still under developement: https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Downloads.jsm
×
×
  • Create New...