Ich erledige solche Arbeiten hiermit: http://www.xnview.com/de/nconvert/
Beiträge von Bitnugger
-
-
_XMLGetValue() liefert dir bei Erfolg als Ergebnis ein Array und die Variable $wert wurde nicht dekalriert!
Dein Script müsste ergo so aussehen...
AutoIt
Alles anzeigen#include <Array.au3> #include <File.au3> #include <_XMLDOMWrapper.au3> Local $xmlFile = "D:\Program Files (x86)\XXX\XXX\data\XXX\Daten\room.xml" If Not FileExists($xmlFile) Then MsgBox(262160, "_XMLGetValue", "Ops, konnte 'room.xml' nicht finden!", 10) Exit 1 EndIf Local $hXML = _XMLFileOpen($xmlFile) If $hXML = 0 Then MsgBox(262160, "_XMLGetValue", "Ops, konnte 'room.xml' nicht öffnen!", 10) Exit 2 EndIf Local $xPath = "/TaskOrder/TemplateTask/data/appointments/appointment/startDate" Local $aStartDate = _XMLGetValue($xPath) If @error Then MsgBox(262160, "_XMLGetValue", "_XMLGetValue konnte den gesuchten Wert nicht finden! " & @error & " " & @extended) Exit 3 Else ConsoleWrite('$aStartDate[1] : ' & $aStartDate[1] & @CRLF) _ArrayDisplay($aStartDate, "$aStartDate") EndIf
-
Hallo @4ern,
die Scripts zu deiner OverMind UDF im ersten Post sind nicht (bzw. nicht mehr) komplett. Da fehlt zumindet die 'OverMind_creator.au3'.
In meinen Archiven habe ich zwar noch eine Version davon, doch mit der aktuellen AutoIT-Version (v3.3.14.2) bekomme ich OverMind nicht ans Laufen. Bekomme von der OverMind_store.exe den Fehler: "Error: Variable used without being declared."
Schade, denn OverMind könnte ich jetzt mehr als gut gebrauchen...
-
-
Sehr schön!
Habe es noch ein wenig an meine Bedürfnisse angepasst und will es Euch nicht vorenthalten...
Spoiler anzeigen
AutoIt
Alles anzeigen;-- TIME_STAMP 2016-05-08 04:46:27 #include <Array.au3> ;#include <_DriveGetFolderExists.au3> Local $aFolder[4] = ['Windows', 'Programme', 'Python3', '_Archive'] $aFilme = _DriveGetFolderExistsExt($aFolder, -1) _ArrayDisplay($aFilme, '$aFilme') _ArrayDisplay(_DriveGetFolderExistsExt('_XXX', -1), 'ForMen') ;-) ; #FUNCTION# ==================================================================================================================== ; Name ..........: _DriveGetFolderExistsExt ; Description ...: Searches the given paths on all drives. You can search for writable (default) and/or read-only pathes. ; Syntax ........: _DriveGetFolderExistsExt($vFolder[, $bWriteable = True|False|-1]) ; Parameters ....: $vFolder - Folder path without drive - 'String', $sVariable or $aArray. ; $bWriteable - [optional] Searched path is writeable: False = not, True (Default) = yes, -1 both. ; Return values .: Success Array with full pathes of all matches. Count of matches in $array[0] ; Failure @error=1, $array[0]=0 - no matches ; Author ........: Bitnugger ; =============================================================================================================================== Func _DriveGetFolderExistsExt($vFolder, $bWriteable=True) Local $aExists[0], $iErr = 0 If IsArray($vFolder) Then For $sFolder In $vFolder $aArray = _DriveGetFolderExists($sFolder, $bWriteable) If Not @error Then _ArrayConcatenate($aExists, $aArray, 1) Next _ArrayInsert($aExists, 0, UBound($aExists)) Else $aExists = _DriveGetFolderExists($vFolder, $bWriteable) EndIf If UBound($aExists) = 0 Then $iErr = 1 Return SetError($iErr,0,$aExists) EndFunc ;==>_DriveGetFolderExistsExt ; #FUNCTION# ==================================================================================================================== ; Name ..........: _DriveGetFolderExists ; Description ...: Searches a given path on all drives. You can search for writable (default) or read-only pathes. ; Syntax ........: _DriveGetFolderExists($sFolder[, $bWriteable = True]) ; Parameters ....: $sFolder - Folder path without drive. ; $bWriteable - [optional] Searched path is (not) writeable. Default is True. ; Return values .: Success Array with full pathes of all matches. Count of matches in $array[0] ; Failure @error=1, $array[0]=0 - no matches ; Author ........: BugFix ; =============================================================================================================================== Func _DriveGetFolderExists($sFolder, $bWriteable=True) Local $aD = DriveGetDrive('all') Local $aExists[$aD[0]+1] = [0] Local $sPath, $iErr = 0 $sFolder = StringRegExpReplace($sFolder, '^(\\+)|(\\+)$', '') For $i = 1 To $aD[0] $sPath = StringFormat('%s\%s', $aD[$i], $sFolder) Switch IsBool($bWriteable) Case 1 If Not FileExists($sPath) And ((StringInStr(FileGetAttrib($sPath), 'R') = 0) = $bWriteable) Then ContinueLoop Case Else If Not FileExists($sPath) Then ContinueLoop EndSwitch $aExists[0] += 1 $aExists[$aExists[0]] = $sPath Next ReDim $aExists[$aExists[0]+1] If $aExists[0] = 0 Then $iErr = 1 Return SetError($iErr,0,$aExists) EndFunc ;==>_DriveGetFolderExists
-
-
Und hier noch eine andere Version...
AutoIt
Alles anzeigen;-- TIME_STAMP 2016-05-02 03:34:49 v 0.1 #include <TreeViewConstants.au3> #include <StructureConstants.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <GuiTreeView.au3> Global $hGUI, $hTreeview, $idTreeview _Test() Func _Test() $hGUI = GUICreate('Test', 210, 210) Local $iStyle = BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES) $idTreeview = GUICtrlCreateTreeView(15, 15, 180, 180, $iStyle, $WS_EX_CLIENTEDGE) $hTreeview = GUICtrlGetHandle(-1) For $i = 0 To 9 GUICtrlCreateTreeViewItem('Item ' & $i, $idTreeview) Next GuiRegisterMsg($WM_NOTIFY, '_WM_NOTIFY') GUISetState() Do Until GUIGetMsg() = -3 EndFunc Func _WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $hWndFrom, $tNMHDR, $iCode $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hTreeview Switch $iCode Case $TVN_KEYDOWN Local $tagTVKEYDOWN = $tagNMHDR & ';WORD wVKey;UINT flags' Local $tTVKEYDOWN = DllStructCreate($tagTVKEYDOWN, $lParam) Local $vKey = DllStructGetData($tTVKEYDOWN, 'wVKey') If $vKey = 32 Then ConsoleWrite("@@ Debug line" & @TAB & @ScriptLineNumber & " var: $vKey --> " & $vKey & @LF) If _GUICtrlTreeView_GetChecked($hTreeview, _GUICtrlTreeView_GetSelection($hTreeview)) Then _GUICtrlTreeView_SetChecked($hTreeview, _GUICtrlTreeView_GetSelection($hTreeview), False) Else _GUICtrlTreeView_SetChecked($hTreeview, _GUICtrlTreeView_GetSelection($hTreeview), True) EndIf ;Return 1 ; Leertaste >> kein Normalverhalten gewünscht (Checkbox soll nicht reagieren) EndIf Case $TVN_SELCHANGEDA, $TVN_SELCHANGEDW Local $tNMTREEVIEW = DllStructCreate($tagNMTREEVIEW, $lParam) Switch DllStructGetData($tNMTREEVIEW, 'Action') Case $TVC_BYKEYBOARD ConsoleWrite('TVC_BYKEYBOARD' & @CRLF) Case $TVC_BYMOUSE ConsoleWrite('TVC_BYMOUSE' & @CRLF) Case $TVC_UNKNOWN ConsoleWrite('TVC_UNKNOWN' & @CRLF) EndSwitch EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc
-
Und wie gefällt dir diese Lösung?
AutoIt
Alles anzeigen;-- TIME_STAMP 2016-05-01 23:08:27 v 0.1 #include <TreeViewConstants.au3> #include <StructureConstants.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> Global $hGUI, $hTreeview, $idTreeview _Test() Func _Test() $hGUI = GUICreate('Test', 210, 210) Local $iStyle = BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES) $idTreeview = GUICtrlCreateTreeView(15, 15, 180, 180, $iStyle, $WS_EX_CLIENTEDGE) $hTreeview = GUICtrlGetHandle(-1) For $i = 0 To 9 GUICtrlCreateTreeViewItem('Item ' & $i, $idTreeview) Next GuiRegisterMsg($WM_NOTIFY, '_WM_NOTIFY') GUISetState() Do Until GUIGetMsg() = -3 EndFunc Func _WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $hWndFrom, $tNMHDR, $iCode Local Static $iSend = 0 $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hTreeview Switch $iCode Case $TVN_KEYDOWN Local $tagTVKEYDOWN = $tagNMHDR & ';WORD wVKey;UINT flags' Local $tTVKEYDOWN = DllStructCreate($tagTVKEYDOWN, $lParam) Local $vKey = DllStructGetData($tTVKEYDOWN, 'wVKey') If $vKey = 32 Then ConsoleWrite("@@ Debug line" & @TAB & @ScriptLineNumber & " var: $vKey --> " & $vKey & @LF) If $iSend = 1 Then $iSend = 0 Return 1 ; Leertaste >> kein Normalverhalten gewünscht (Checkbox soll nicht reagieren) Else $iSend = 1 ControlSend($hGUI, '', $idTreeview, '{SPACE}') Return 1 ; Leertaste >> kein Normalverhalten gewünscht (Checkbox soll nicht reagieren) EndIf EndIf Case $TVN_SELCHANGEDA, $TVN_SELCHANGEDW Local $tNMTREEVIEW = DllStructCreate($tagNMTREEVIEW, $lParam) Switch DllStructGetData($tNMTREEVIEW, 'Action') Case $TVC_BYKEYBOARD ConsoleWrite('TVC_BYKEYBOARD' & @CRLF) Case $TVC_BYMOUSE ConsoleWrite('TVC_BYMOUSE' & @CRLF) Case $TVC_UNKNOWN ConsoleWrite('TVC_UNKNOWN' & @CRLF) EndSwitch EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc
-
So in etwa...
AutoIt
Alles anzeigen;-- TIME_STAMP 2016-05-01 19:58:54 #Region ;************ Includes ************ ;~ #include <Constants.au3>;~~~ ;~ #include <GUIConstants.au3>;~~~ #include <WindowsConstants.au3> #include <WinAPI.au3> #include <TreeViewConstants.au3> ;~ #include <StructureConstants.au3>;~~~ #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #EndRegion ;************ Includes ************ $hCallback = DllCallbackRegister("_KeyProc", "long", "int;wparam;lparam") $hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($hCallback), _WinAPI_GetModuleHandle(0)) GUISetOnEvent($GUI_EVENT_CLOSE, "Event_Close") Global $hGUI, $hTreeview, $idTreeview _Test() Func _Test() $hGUI = GUICreate('Test', 210, 210) Local $iStyle = BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES) $idTreeview = GUICtrlCreateTreeView(15, 15, 180, 180, $iStyle, $WS_EX_CLIENTEDGE) $hTreeview = GUICtrlGetHandle(-1) For $i = 0 To 9 GUICtrlCreateTreeViewItem('Item ' & $i, $idTreeview) Next GUISetState() Do Until GUIGetMsg() = -3 EndFunc ;==>_Test Func _KeyProc($nCode, $wParam, $lParam) ;subclassing If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) Local $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam) Local $iSpace = 0 Switch $wParam Case $WM_KEYUP If DllStructGetData($tKEYHOOKS, "vkCode") = 0x20 Then ConsoleWrite("Space wurde losgelassen." & @CRLF) $iSpace = 1 EndIf Case $WM_KEYDOWN If DllStructGetData($tKEYHOOKS, "vkCode") = 0x20 Then ConsoleWrite("Space wurde gedrückt." & @CRLF) $iSpace = 1 EndIf EndSwitch If $iSpace = 1 Then $sClassNameFocus = ControlGetFocus($hGUI) $sClassName = _WinAPI_GetClassName($hTreeview) If StringInStr($sClassNameFocus, $sClassName) = 0 Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) Else ConsoleWrite('Space wird ignoriert...' & @CRLF) Return 1 EndIf EndIf EndFunc ;==>_KeyProc Func Event_Close() _WinAPI_UnhookWindowsHookEx($hHook) DllCallbackFree($hCallback) GUIDelete() Exit EndFunc ;==>Event_Close
-
Nein, zaubern kann ich sicher nicht... leider - ich vertraue jedoch darauf, dass @mm4040 mit den korrigierten Zeilen aus seinem Beispiel in Post #1 etwas anzufangen weiß.
-
AutoIt
Dim $aBefehl[2][2]=[ _ ['test1', $Label1], _ ['test2', $Label2]] _ArrayDisplay($aBefehl) GUICtrlSetState($aBefehl[0][1],$GUI_CHECKED)
So funktioniert es, da nun nicht der Name der Variable als 'Text' im Array gespeichert wird, sondern die benötigte ID des Controls, welches du mit GUICtrlSetState() ansprechen willst.
-
Ich denke, dein RunWait() ist fehlerhaft, da der Druckername nicht in Quote übergeben wird und der Name wohl auch nicht korrekt ist.
Versuche es mal hiermit...
AutoIt
Alles anzeigen;-- TIME_STAMP 2016-04-21 15:40:53 $ordner = "\\server\atv\_0-print\print-hms-0eg-A4\" $archiv = "\\server\atv\_0-print\print-hms-0eg-A4\_printed\" $foxit = "C:\Program Files (x86)\Foxit Software\Foxit Reader\FoxitReader.exe" $printer = "\\MATBFS001\Dell C3765dnf EG" While 1 Sleep(1000) $file = FileFindFirstFile($ordner & "*.pdf") If $file <> -1 Then Print() FileClose($file) WEnd Func Print() While 1 $pdffile = FileFindNextFile($file) $neuname = @YEAR & @MON & @MDAY & @HOUR & @MIN & @SEC & @MSEC & ".pdf" If @error Then ExitLoop FileMove($ordner & $pdffile, $archiv & $neuname) While 1 Sleep(100) If FileExists($archiv & $neuname) Then ExitLoop EndIf WEnd ConsoleWrite('RunWait(' & '"' & $foxit & '" /t "' & $archiv & $neuname & '" "' & $printer & '"' & ')' & @CRLF) RunWait('"' & $foxit & '" /t "' & $archiv & $neuname & '" "' & $printer & '"') If @error Then ConsoleWrite("RunWait: Bei der Ausführung von FoxitReader ist ein Fehler aufgetreten. #Error: " & @error & @CRLF) WEnd EndFunc
-
Hihi, ja lustig... so funktioniert es allerdings nur mit einem Monitor, ich habe aber zwei.
Schön wäre auch, wenn nur bei z. B. MouseGetCoursor() = 2 das Bild eingeblendet wird. -
Unter Windows 10 Pro (64-Bit) funktioniert Unlocker in vielen Situationen nicht mehr, deshalb habe ich nach einer guten Alternative gesucht und dann nach langer Suche das Tool "DeadLock" gefunden, mit dem ich sehr zufrieden bin.
Infos in DE, Bilder und Download
http://winfuture.de/downloadvorschalt,3689.htmlHerstellerseite (EN)
http://codedead.com/?page_id=822@Kawooshe
Bei selbst erzeugten Verzeichnissen/Dateien bist Du der Eigentümer und hast automatisch auch Vollzugriff. Daher kannst du diese Sachen auch generell immer löschen, wenn sie nicht gerade von einer anderen Anwendung oder dem System in Krallen gehalten wird. -
Die MsgBox() blockiert doch die Ausführung des Script - _ChangeIcon() kann ergo erst ausgeführt werden, nachdem sie geschlossen wurde.
-
Das Installationsdatum hat lediglich informativen Charakter und kann bei Bedarf beliebig geändert werden.
Siehe hier: http://www.windows7-tuning.de/tuning-tipps-a…anzeigenandern/
-
AutoIt
Alles anzeigen;-- TIME_STAMP 2016-01-02 18:13:56 If WinExists("[CLASS:MozillaWindowClass]") = 0 Then MsgBox(266256,"Error", "'Firefox' ist wohl noch nicht gstartet worden!") Else WinActivate("[CLASS:MozillaWindowClass]") If WinWaitActive("[CLASS:MozillaWindowClass]", "", 30) = 0 Then MsgBox(266256,"Error", "'Firefox' konnte nicht aktiviert werden!") Else Sleep(1250) Send("!s") ; Alt + s - Adressfeld aktivieren Sleep(250) Send("^c") ; Ctrl + c - Adresse in Zwischenablage kopieren ; Links.doc in Word öffnen ShellExecute(@DesktopDir & "\Links.doc") WinActivate("Links.doc") If WinWaitActive("Links.doc", "", 30) = 0 Then MsgBox(266256,"Error", "'" & @DesktopDir & "\Links.doc' konnte nicht geöffnet werden!") Else Send("^v") Send("{Enter}") EndIf EndIf EndIf
Edit: Rückgabewert = Return Value
Wobei zwei Fälle zu unterscheiden sind...
Erfolg (Success) - meist ungleich 0
Fehler (Failure) - meist 0 oder -1 und/oder @error und evtl. @extended ist/sind gesetzt -
AutoIt
Alles anzeigen;-- TIME_STAMP 2016-01-02 16:42:19 #Region ;************ Includes ************ #Include <AutoItConstants.au3> #include <GUIConstantsEx.au3> #EndRegion ;************ Includes ************ $Form1 = GUICreate("test", 500, 350, -1, -1) ; This key can be empty... so it is an insecure source to get information. ; $Label2_instdate = GUICtrlCreateLabel((_DateAdd("s", RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "InstallDate"), "1970/01/01 00:00:00")), 180, 220, 180, 17) ; Hereby it works safer... Local $iPID = Run("powershell.exe" & " ([WMI]'').ConvertToDateTime((Get-WmiObject Win32_OperatingSystem).InstallDate)", "", @SW_HIDE, $STDOUT_CHILD) ; Wait until the process has closed using the PID returned by Run. ProcessWaitClose($iPID) ; Read the Stdout stream of the PID returned by Run. Local $sOutput = StdoutRead($iPID) Local $Label2_instdate = GUICtrlCreateLabel($sOutput, 180, 220, 180, 26) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
-
AutoIt
Alles anzeigen;-- TIME_STAMP 2016-01-02 15:18:21 #include <FF.au3> #include <Word.au3> #include <MsgBoxConstants.au3> If _FFConnect() Then Local $sHref = _FFCmd(".location.href") ConsoleWrite("$sHref: " & $sHref & @CRLF) ; disconnect from FireFox _FFDisConnect() If $sHref <> "" Then ; Create application object Local $oWord = _Word_Create() If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocLinkAdd Example", _ "Error creating a new Word application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ; Open test.doc read-only Local $oDoc = _Word_DocOpen($oWord, "C:\Program Files (x86)\AutoIt3\Examples\Helpfile\Extras\Test.doc", Default, Default, True) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocLinkAdd Example", _ "Error opening 'C:\Program Files (x86)\AutoIt3\Examples\Helpfile\Extras\Test.doc'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ; ***************************************************************************** ; Insert the link from current FireFox-Tab as the fourth word ; ***************************************************************************** Local $oRange = _Word_DocRangeSet($oDoc, -1, $wdWord, 3, $wdWord, 1) _Word_DocLinkAdd($oDoc, $oRange, $sHref) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocLinkAdd Example", _ "Error adding a link to the document." & @CRLF & "@error = " & @error & ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocLinkAdd Example", "The link from current FireFox-Tab has been inserted as the fourth word.") Else MsgBox($MB_SYSTEMMODAL, "FF UDF: _FFCmd() failed", _ "Error - the actual Tab is empty." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Exit 2 EndIf Else MsgBox($MB_SYSTEMMODAL, "FF UDF: _FFConnect() failed", _ "Error - Do you have the MozRepl addon installed / running?" & @CRLF & "@error = " & @error & ", @extended = " & @extended) Exit 1 EndIf
-
_DateDiff erwartet übrigens
Backslashes zwischen Jahr/Monat/Tag und eben auch diese Reihenfolge.Mit Freud'schen Grüßen