#include <file.au3>

Dim $Scite = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir") & "\SciTe\"
Dim $path = @HomeDrive & @HomePath & "\abbrev.properties"
Dim $pathKeyAbb = $Scite & "au3.keywords.abbreviations.properties"
Dim $startStr = '#endregion - ctrl+b', $start = False
Dim $ar, $aAbbr[1]=[0], $var

_FileReadToArray($path, $ar)
For $i = 1 to $ar[0]
	If $ar[$i] == $startStr Then $start = True
	If $start And StringInStr($ar[$i], '=') Then
		$var = StringSplit($ar[$i], '=')
		ReDim $aAbbr[UBound($aAbbr)+1]
		$aAbbr[UBound($aAbbr)-1] = $var[1]
		$aAbbr[0] += 1
	EndIf
Next

FileMove($pathKeyAbb, $pathKeyAbb & '.BAK',1)
Dim $fh = FileOpen($pathKeyAbb, 1), $line = 'au3.keywords.abbrev=', $count = 1
FileWriteLine($fh, @LF & @LF)
For $i = 1 To $aAbbr[0]
	If $count < 15 Then 
		$line &= $aAbbr[$i] & ' '
	Else
		$line &= $aAbbr[$i] & ' \'
		FileWriteLine($fh, $line)
		$line = @TAB & ''
		$count = 0
	EndIf
	If $count < 15 And $i = $aAbbr[0] Then FileWriteLine($fh, $line)
	$count += 1
Next
FileClose($fh)
MsgBox(0, '', 'Neue Abkürzungsdatei erstellt')