hallo
hab mir mal ein kleines Script gebastelt
Ich find es für php oder ähnliches ganz nützlich.
Features:
- mehrere Pattern können auf einmal bearbeitet werden.
- Es können auch crlfs ersetzt werden.
Nachteil:
-bis jetzt kann man noch keine pipe( | ) ersetzen
Spoiler anzeigen
#include <GUIConstants.au3>
#include <string.au3>
#include <guiedit.au3>
HotKeySet("^a","_mark")
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Replacer", 633, 455, 0, 0, -1,$WS_EX_TOOLWINDOW)
GUISetBkColor(0xFFFFFF)
$Edit1 = GUICtrlCreateEdit("", 8, 8, 481, 441)
$Edit2 = GUICtrlCreateEdit("", 496, 192, 129, 257)
$Button1 = GUICtrlCreateButton("Replace", 504, 24, 123, 25, 0)
$Button2 = GUICtrlCreateButton("Clipput", 504, 64, 123, 25, 0)
$Button3 = GUICtrlCreateButton("Hilfe", 504, 104, 123, 25, 0)
$Label1 = GUICtrlCreateLabel("Replace-pattern:", 504, 160, 83, 17)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_replace()
Case $Button2
ClipPut(GUICtrlRead($Edit1))
Case $Button3
MsgBox(48,"Hilfe","|Replacestring=Newstring|"&@CRLF&@CRLF&"um z.B. alle @crlfs mit \n zu ersetzten benutze die Pattern:"&@CRLF&@CRLF&"|"&@CRLF&"=/n|"&@CRLF&@CRLF&"Man kann mauch mehrere Pattern auf einmal angeben:"&@CRLF&"|123=456|"&@CRLF&"|456=789|")
EndSwitch
WEnd
Func _replace()
$toreplace = GUICtrlRead($Edit1)
$pattern = GUICtrlRead($Edit2)
If $pattern = "" Then
MsgBox(16,"Error","keine Pattern gefunden")
Return 0
EndIf
$pattern = _StringBetween($pattern,"|","|")
If Not IsArray($pattern) Then
MsgBox(16,"Error","ein Fehler ist aufgetreten")
Return 0
EndIf
For $i = 0 To UBound($pattern)-1
$replace = StringSplit($pattern[$i],"=")
If Not IsArray($replace) Then
MsgBox(16,"Error","Ein Fehler ist aufgetreten")
Return 0
EndIf
$toreplace = StringReplace($toreplace,$replace[1],$replace[2])
Next
GUICtrlSetData($Edit1,$toreplace)
EndFunc
Func _mark()
If Not WinActive("Replace","") Then
HotKeySet("^a")
Send("^a")
HotKeySet("^a","_mark")
Return 0
EndIf
_GUICtrlEditSetSel($Edit1,0,StringLen(GUICtrlRead($Edit1)))
EndFunc
mfg
edit: jetzt geht strg+a auch:) (zumindest bei edit1)
@huggy echt? wo?
derda
ps: jemand ne idee wie ich eine toolwindow-gui machen kann, die aber trotzdem ein "feld" in der taskleiste hat?.