Fumktioniert zwar, aber das fängt trotzdem so an: Skifahren_1, Skifahren_10, Skifahren_11,
Beiträge von Greek
-
-
O.o warum ist das dann bei so komisch =(
Hat jemand auch das Problem das ich hab?
-
Hallo,
hab ein Tool geschrieben mit dem man viele Dateien auf einmal umbenennen kann. Funktioniert auch, aber die Zahl Hintendran ist komisch.
Bei mir ist das immer so. Ich nen jetzt ca. 40 Bilder um, dann fängt das so an:
Skiurlaub_1, Skiurlaub_10, Skiurlaub_11...
Wenn ich die dann nochma umnenne steht das da:
Skiurlaub_100, Skiurlaub_101, Skiurlaub_102...
Und beim dritten mal das:
Skiurlaub_1000, Skiurlaub_1001, Skiurlaub_1002Spoiler anzeigen
[autoit]#include <ButtonConstants.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>#Region ### START Koda GUI section ### Form=
[/autoit] [autoit][/autoit] [autoit]
$Form1 = GUICreate("Rename", 153, 231, 652, 344)
GUISetBkColor(0x808080)
$Input1 = GUICtrlCreateInput("", 16, 40, 121, 21)
$Input2 = GUICtrlCreateInput("", 48, 96, 65, 21)
$Label1 = GUICtrlCreateLabel("Endung ", 56, 72, 44, 17)
$Label2 = GUICtrlCreateLabel("Pfad zum Ordner ", 40, 8, 86, 17)
$Button1 = GUICtrlCreateButton("Umbennen", 40, 192, 75, 25, 0)
$Input3 = GUICtrlCreateInput("", 16, 160, 121, 21)
$Label3 = GUICtrlCreateLabel("Neuer Name", 48, 128, 64, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###Global $n=1
[/autoit] [autoit][/autoit] [autoit]While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$pfad=GUICtrlRead( $Input1 )
$endung=GUICtrlRead( $Input2 )
$name=GUICtrlRead( $Input3 )
$search = FileFindFirstFile($pfad&"\*."&$endung)
If $search = -1 Then
MsgBox(0, "Error", "Keine Datei mit der Endung "&$endung&" in "&$pfad&" gefunden")
Exit
EndIf
While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop
_Umbenennen($file)
$n+=1
WEnd
$n=1
EndSwitch
WEndFunc _Umbenennen($sFile)
[/autoit]
FileMove ($pfad&"\"&$sFile, $pfad&"\"&$name&"_"&$n&"."&$endung, 1)
EndFunc -
Ja, es passiert eben nichts^^
Versteht die Funktion auch überhaupt nicht, muss mir wohl doch meine eigene schreiben.
-
Hallo
Hab das hier geschrieben:
Spoiler anzeigen
[autoit]#include <ButtonConstants.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>#Region ### START Koda GUI section ### Form=
[/autoit] [autoit][/autoit] [autoit]
$Form1 = GUICreate("Rename", 153, 231, 652, 344)
GUISetBkColor(0x808080)
$Input1 = GUICtrlCreateInput("", 16, 40, 121, 21)
$Input2 = GUICtrlCreateInput("", 48, 96, 65, 21)
$Label1 = GUICtrlCreateLabel("Endung ", 56, 72, 44, 17)
$Label2 = GUICtrlCreateLabel("Pfad zum Ordner ", 40, 8, 86, 17)
$Button1 = GUICtrlCreateButton("Umbennen", 40, 192, 75, 25, 0)
;~ $Input3 = GUICtrlCreateInput("", 16, 160, 121, 21)
;~ $Label3 = GUICtrlCreateLabel("Neuer Name", 48, 128, 64, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$pfad=GUICtrlRead( $Input1 )
$endung=GUICtrlRead( $Input2 )
;~ $name=GUICtrlRead( $Input3 )
$search = FileFindFirstFile($pfad&"\*."&$endung)
If $search = -1 Then
MsgBox(0, "Error", "Keine Datei mit der Endung "&$endung&" in "&$pfad&" gefunden")
Exit
EndIf
While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop
__CopyEnum($file)
WEnd
FileClose($search)
EndSwitch
WEndFunc __CopyEnum($sFile)
[/autoit]
Local $iI=1, $aTmp
$aTmp = StringSplit($sFile, ".")
$sFileName = StringTrimRight($sFile, StringLen($aTmp[$aTmp[0]])+1)
$sFileExt = "." & $aTmp[$aTmp[0]]
If FileExists($sFile) Then
While FileExists($sFileName & "-" & $iI & $sFileExt)
$iI +=1
WEnd
For $iJ=$iI To 1 Step -1
FileMove($sFileName & "-" & $iJ & $sFileExt, $sFileName & "-" & $iJ+1 & $sFileExt)
Next
FileCopy($sFile , $sFileName & "-1" & $sFileExt)
EndIf
EndFunc ;==> __CopyEnumAber was passiert jetzt da?^^ Ich weis jetzt selber nicht was ich geschrieben hab, dachte CopyEnum macht irgendwie nen namen mit Zahlen Hintendran.
-
Find die _INetSmtpMailCom Funktion besser, hier mal nen Script, wie sie Funktioniert.
Spoiler anzeigen
[autoit]#cs ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]AutoIt Version: 3.3.0.0
[/autoit] [autoit][/autoit] [autoit]
Author: GreekScript Function:
[/autoit] [autoit][/autoit] [autoit]
Template AutoIt script.#ce ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]; Script Start - Add your code below here
[/autoit] [autoit][/autoit] [autoit]#include <ButtonConstants.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>Global $oMyRet[2]
[/autoit] [autoit][/autoit] [autoit]
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")#Region ### START Koda GUI section ### Form=
[/autoit] [autoit][/autoit] [autoit]
$Form1 = GUICreate("Email versender", 396, 294, 1153, 185)
$Input1 = GUICtrlCreateInput("", 8, 40, 121, 21)
$Input2 = GUICtrlCreateInput("", 248, 40, 121, 21)
$Label1 = GUICtrlCreateLabel("Mail sever: Für http://www.web.de ist er smtp.web.de ", 8, 16, 229, 17)
$Label2 = GUICtrlCreateLabel("Name des Absenders", 248, 16, 105, 17)
$Label3 = GUICtrlCreateLabel("Absender email addresse", 8, 72, 122, 17)
$Input3 = GUICtrlCreateInput("", 8, 96, 121, 21)
$Input4 = GUICtrlCreateInput("", 248, 96, 121, 21)
$Label4 = GUICtrlCreateLabel("Empfänger email addresse", 248, 72, 128, 17)
$Input5 = GUICtrlCreateInput("", 8, 152, 121, 21)
$Label5 = GUICtrlCreateLabel("Betreff", 8, 128, 35, 17)
$Label6 = GUICtrlCreateLabel(" Text ", 248, 128, 34, 17)
$Input6 = GUICtrlCreateInput("", 248, 152, 121, 21)
$Label7 = GUICtrlCreateLabel("Nochmal Absender email", 8, 184, 121, 17)
$Input7 = GUICtrlCreateInput("", 8, 208, 121, 21)
$Input8 = GUICtrlCreateInput("", 248, 208, 121, 21)
$Label8 = GUICtrlCreateLabel("Passwort der Absender email", 248, 184, 140, 17)
$Button1 = GUICtrlCreateButton("Email versenden", 152, 248, 100, 25, 0)
$Button2 = GUICtrlCreateButton("Abbrechen", 312, 256, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###While 1
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$rc = _INetSmtpMailCom(GUICtrlRead( $Input1),GUICtrlRead($Input2),GUICtrlRead($Input3), GUICtrlRead($Input4), GUICtrlRead($Input5), GUICtrlRead($Input6), "", "","", GUICtrlRead($Input7), GUICtrlRead($Input8))
If @error then
msgbox(0,"Error sending message","Error code:" & @error & " Description:" & $rc)
EndIf
Case $Button2
Exit
EndSwitch
WEnd
[/autoit]
Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Username = "", $s_Password = "")
$objEmail = ObjCreate("CDO.Message")
$objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'
$objEmail.To = $s_ToAddress
Local $i_Error = 0
Local $i_Error_desciption = ""
If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress
If $s_BccAddress <> "" Then $objEmail.Cc = $s_BccAddress
$objEmail.Subject = $s_Subject
If StringInStr($as_Body,"<") and StringInStr($as_Body,">") Then
$objEmail.HTMLBody = $as_Body
Else
$objEmail.Textbody = $as_Body & @CRLF
EndIf
If $s_AttachFiles <> "" Then
Local $S_Files2Attach = StringSplit($s_AttachFiles, ";")
For $ex = 1 To $S_Files2Attach[0]
$S_Files2Attach[$x] = _PathFull ($S_Files2Attach[$x])
If FileExists($S_Files2Attach[$x]) Then
$objEmail.AddAttachment ($S_Files2Attach[$x])
Else
$i_Error_desciption = $i_Error_desciption & @lf & 'File not found to attach: ' & $S_Files2Attach[$x]
SetError(1)
return 0
EndIf
Next
EndIf
$objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
$objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer
$objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
;Authenticated SMTP
If $s_Username <> "" Then
$objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
$objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username
$objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password
EndIf
;Update settings
$objEmail.Configuration.Fields.Update
; Sent the Message
$objEmail.Send
if @error then
SetError(2)
return $oMyRet[1]
EndIf
EndFunc;==>_INetSmtpMailCom
;
;
; Com Error Handler
Func MyErrFunc()
$HexNumber = Hex($oMyError.number,
$oMyRet[0] = $HexNumber
$oMyRet[1] = StringStripWS($oMyError.description,3)
ConsoleWrite("### COM Error ! Number: " & $HexNumber & " ScriptLine: " & $oMyError.scriptline & " Description:" & $oMyRet[1] & @LF)
SetError(1); something to check for when this function returns
Return
EndFunc;==>MyErrFunc -
Da ist doch nen Super Beispiel mit dem Papierkorb dabei, guck das mal an, ist verständlich gemacht.
-
Also die Funktion _Imagesearch gibt es:
http://www.autoitscript.com/forum/index.php?showtopic=65748&st=15
-
Ich find die Funktion hier am besten ( besonders weil sie als einzige bei mir geht^^ )
Hat kein Fenster oder so, ist einfach super =)Spoiler anzeigen
[autoit]Global $oMyRet[2]
[/autoit]
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
$rc = _INetSmtpMailCom($mail_server,$absender_name,$absender_adresse, $empfaenger_adresse, $betreff, $nachrichtentext, $anhang, $cc_emfaenger,$bcc_empfaenger, $mail_benutzername, $mail_passwort)
If @error then
msgbox(0,"Error sending message","Error code:" & @error & " Description:" & $rc)
EndIf
Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Username = "", $s_Password = "")
$objEmail = ObjCreate("CDO.Message")
$objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'
$objEmail.To = $s_ToAddress
Local $i_Error = 0
Local $i_Error_desciption = ""
If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress
If $s_BccAddress <> "" Then $objEmail.Cc = $s_BccAddress
$objEmail.Subject = $s_Subject
If StringInStr($as_Body,"<") and StringInStr($as_Body,">") Then
$objEmail.HTMLBody = $as_Body
Else
$objEmail.Textbody = $as_Body & @CRLF
EndIf
If $s_AttachFiles <> "" Then
Local $S_Files2Attach = StringSplit($s_AttachFiles, ";")
For $ex = 1 To $S_Files2Attach[0]
$S_Files2Attach[$x] = _PathFull ($S_Files2Attach[$x])
If FileExists($S_Files2Attach[$x]) Then
$objEmail.AddAttachment ($S_Files2Attach[$x])
Else
$i_Error_desciption = $i_Error_desciption & @lf & 'File not found to attach: ' & $S_Files2Attach[$x]
SetError(1)
return 0
EndIf
Next
EndIf
$objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
$objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer
$objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
;Authenticated SMTP
If $s_Username <> "" Then
$objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
$objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username
$objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password
EndIf
;Update settings
$objEmail.Configuration.Fields.Update
; Sent the Message
$objEmail.Send
if @error then
SetError(2)
return $oMyRet[1]
EndIf
EndFunc;==>_INetSmtpMailCom
;
;
; Com Error Handler
Func MyErrFunc()
$HexNumber = Hex($oMyError.number,
$oMyRet[0] = $HexNumber
$oMyRet[1] = StringStripWS($oMyError.description,3)
ConsoleWrite("### COM Error ! Number: " & $HexNumber & " ScriptLine: " & $oMyError.scriptline & " Description:" & $oMyRet[1] & @LF)
SetError(1); something to check for when this function returns
Return
EndFunc;==>MyErrFunc -
Oh man!! Man kann ja auch einfach die ID reinschreiben XDDD
Spoiler anzeigen
[autoit]HotKeySet ( "!{F1}", "_Ziehen" )
[/autoit] [autoit][/autoit] [autoit]
HotKeySet ( "!{F3}", "end" )Global $source=""
[/autoit] [autoit][/autoit] [autoit]Global $dest=InputBox ( "Ziel", "Ziel eingeben des Ordners z.B. C:\Dokumente und Einstellungen\user\Desktop\Neuer Ordner" )
[/autoit] [autoit][/autoit] [autoit]
If $dest=1 or $dest="" Then Exit
MsgBox ( 0, "Anleitung", "Mit Alt+F3 Beenden, Geh auf ein Lied in deinem Winmap und drücke auf Titelinformation anzeigen, danach Alt+F1 drücke und das Lied wird rübergezogen" )
While 1
WEndFunc _Ziehen()
[/autoit] [autoit][/autoit] [autoit]
If WinExists ( "Titelinformationen" ) Then
$source=ControlGetText ( "Titelinformationen", "", 1084 )
EndIf
FileCopy ( $source, $dest, 9 )
EndFuncFunc end()
[/autoit]
Exit
EndFuncDamit wär das Problem gelöst =D
-
Musste das jetzt nun Umständlich lösen, aber es Funktioniert immerhin =)
Spoiler anzeigen
[autoit]HotKeySet ( "!{F1}", "_Ziehen" )
[/autoit] [autoit][/autoit] [autoit]
HotKeySet ( "!{F3}", "end" )Global $source=""
[/autoit] [autoit][/autoit] [autoit]Global $dest=InputBox ( "Ziel", "Ziel eingeben des Ordners z.B. C:\Dokumente und Einstellungen\user\Desktop\Neuer Ordner" )
[/autoit] [autoit][/autoit] [autoit]
If $dest=1 or $dest="" Then Exit
MsgBox ( 0, "Anleitung", "Mit Alt+F3 Beenden, Geh auf ein Lied in deinem Winmap und drücke auf Titelinformation anzeigen, danach Alt+F1 drücke und das Lied wird rübergezogen" )
While 1
WEndFunc _Ziehen()
[/autoit] [autoit][/autoit] [autoit]
If WinExists ( "Titelinformationen" ) Then
$source=ControlGetText ( "Titelinformationen", "", "Edit16" )
EndIf
If $source="" Then
$source=ControlGetText ( "Titelinformationen", "", "Edit18" )
EndIf
If $source="" Then
$source=ControlGetText ( "Titelinformationen", "", "Edit40" )
EndIf
If $source="" Then
$source=ControlGetText ( "Titelinformationen", "", "Edit42" )
EndIf
If $source="" Then
MsgBox ( 0, "Fehler", "Edit nicht in der Liste" )
EndIf
FileCopy ( $source, $dest, 9 )
EndFuncFunc end()
[/autoit]
Exit
EndFuncKann das mal einer testen ob das auch bei anderen Funktioniert? Ich glaub nämlich das mit der Edit Instance hängt mit dem Datentype zusammen. Alle mp3 haben Edit40, alle wma Edit16, usw...
-
Ja ist es, wenn Ich "Edit16" reinschreibe erhalte ich auch das richtige.
-
-
Hab das jetzt so
[autoit]$source=ControlGetText ( "Titelinformationen", "", "[CLASS:Edit; X:11; Y:11; W:528; H:20]" )
[/autoit]
aber funktioniert nicht ... -
Hallo
[Blockierte Grafik: http://img7.imageshack.us/img7/406/autoitithilfebildbn9.jpg]
Ich hab was geschrieben womit ich meine Lieder von Winamp direkt in nen Ordner ziehen kann. Aber nun hat das Edit woher ich weis wo die Datei liegt, manchmal ne andere Instance...
Fast alle Lieder haben 40, aber leider nicht alle.Gibts da was, woher ich weis welche Instance das Edit hat?
-
Ok danke, dann werde ich mal Xubuntu ausprobieren =)
-
Hallo
Ich habe noch einen PC bei mir Zuhause stehen, auf dem ich gerne Linux installieren möchte.
Intel Pentium 4, 1700 MHz
256 Arbeitsspeicher, Festplatte 80 GBNun ist aber das Problem das anscheinend nicht jede Linux Distribution auf diesem PC läuft.
Als erstes hatte ich Ubuntu:
Das hatte aber den Fehler das ich es nicht runterfahren konnte.Danach OpenSuse 11.1:
Ging schon bei der Installation nicht. Falsche Prüfsumme. Sollte eigentlich an der CD liegen, aber hab es nochma von nem Freund gebrannt grigt und es kam der selbe Fehler.Könnte mir jemand ein gute Linux Distribution für diese Hardware nennen?
-
-
[autoit]
#include <Misc.au3>
[/autoit][autoit][/autoit][autoit]$dll = DllOpen("user32.dll")
[/autoit][autoit][/autoit][autoit]While 1
[/autoit]
Sleep ( 50 )
If _IsPressed("41", $dll) Then ;Wenn a gedrückt wurde...
Do
Sleep ( 50 ) ;Wartet er...
Until _IsPressed("42", $dll);Bis b gedrückt wurde. Liste mit den Nummern für die Buchstaben in der Hilfe
MsgBox ( 0, "Hilfe für Hellwave", "Tag =)", 2 )
Exit
EndIf
WEnd
DllClose($dll) -
Ich denke das ist die Funktion die in Zeile 15 aufgerufen wird.
[autoit]_GuiHole($gui, 0, 0, 150, 150)
[/autoit]