I made this
1. I extract all words from a text file, And list them in line. (Using WebParser, meter=string)
2. When I click a extracting word, the word is written in new text file (using !WriteKeyValue)
It works fine, but the code is too long.
I would like to ask if there is a way to drastically reduce it.
example1. I want to reduce the repeated code.(I want 100 StringIndex)
Code: Select all
RegExp=(?siU)](.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\.....
Code: Select all
[AA0001]
Measure=Plugin
Plugin=Plugins\WebParser.dll
~
[AA0100]
Measure=Plugin
Plugin=Plugins\WebParser.dll
example3. I want to reduce the number of repeating meters.
However, the number inside the meter also increases by one.
Code: Select all
[Output1]
meter=String
MeasureName=AA0001
DynamicVariables = 1
LeftMouseUpAction=[!CommandMeasure "OutPutR1" "ExecuteBatch 1"][!RainmeterRedraw]
~
[Output100]
meter=String
MeasureName=AA0100
DynamicVariables = 1
LeftMouseUpAction=[!CommandMeasure "OutPutR100" "ExecuteBatch 1"][!RainmeterRedraw]
Summary version of the actual skin for how it works
(I've cut down parts for explanation and I'm not sure if it works.)
Code: Select all
[Rainmeter]
Update=100
DynamicWindowSize=1
[Metadata]
XXXXX
[Variables]
MyFile=file://C:\Users\USER\Documents\Rainmeter\Skins\Eng\@Resources\TXT.inc
LogMax=1000
LogNum=0
-3=
-2=
-1=
0=
-[WebPhaser]---------------------------------------------------------------------------------------------------
[AA0001]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=#MyFile#
RegExp=(?siU)](.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.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*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)
StringIndex=2
RegExpSubstitute=1
substitute = "#CRLF#":""
CodePage=949
[AA0003]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=#MyFile#
RegExp=(?siU)](.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)
StringIndex=3
RegExpSubstitute=1
substitute = "#CRLF#":""
CodePage=949
[AA0004]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=#MyFile#
RegExp=(?siU)](.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)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\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)
StringIndex=5
RegExpSubstitute=1
substitute = "#CRLF#":""
CodePage=949
[AA0012]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=#MyFile#
RegExp=(?siU)](.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)
StringIndex=12
RegExpSubstitute=1
substitute = "#CRLF#":""
CodePage=949
[AA0013]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=#MyFile#
RegExp=(?siU)](.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)\ (.*)
StringIndex=13
RegExpSubstitute=1
substitute = "#CRLF#":""
CodePage=949
-[Output]------------------------------------------------------------------------------------------------------------
[Output1]
meter=String
MeasureName=AA0001
DynamicVariables = 1
Text=%1
X=0
Y=100
UpdateDivider = 1
AntiAlias=1
[Output2]
meter=String
MeasureName=AA0002
DynamicVariables = 1
Text=%1
X=0R
Y=0r
UpdateDivider = 1
AntiAlias=1
LeftMouseUpAction=[!CommandMeasure "OutPutR2" "ExecuteBatch 1"][!RainmeterRedraw]
[Output3]
meter=String
MeasureName=AA0003
DynamicVariables = 1
Text=%1
X=0R
Y=0r
UpdateDivider = 1
AntiAlias=1
LeftMouseUpAction=[!CommandMeasure "OutPutR3" "ExecuteBatch 1"][!RainmeterRedraw]
[Output4]
meter=String
MeasureName=AA0004
DynamicVariables = 1
Text=%1
X=0R
Y=0r
UpdateDivider = 1
AntiAlias=1
LeftMouseUpAction=[!CommandMeasure "OutPutR4" "ExecuteBatch 1"][!RainmeterRedraw]
[Output5]
meter=String
MeasureName=AA0005
DynamicVariables = 1
Text=%1
X=0R
Y=0r
UpdateDivider = 1
AntiAlias=1
LeftMouseUpAction=[!CommandMeasure "OutPutR5" "ExecuteBatch 1"][!RainmeterRedraw]
...
[Output12]
meter=String
MeasureName=AA0012
DynamicVariables = 1
Text=%1
X=0
Y=25r
UpdateDivider = 1
AntiAlias=1
LeftMouseUpAction=[!CommandMeasure "OutPutR12" "ExecuteBatch 1"][!RainmeterRedraw]
[Output13]
meter=String
MeasureName=AA0013
DynamicVariables = 1
Text=%1
X=0R
Y=0r
UpdateDivider = 1
AntiAlias=1
LeftMouseUpAction=[!CommandMeasure "OutPutR13" "ExecuteBatch 1"][!RainmeterRedraw]
-[OutPutR]-------------------------------------------------------------------------------------------------------------
[OutPutR1]
Measure=Plugin
Plugin=InputText
DefaultValue=1
Command1=[!WriteKeyValue Variables LogNum [CLC_NumPlus]][!SetVariable LogNum [CLC_NumPlus]][!WriteKeyValue Variables [CLC_Num3] "[AA0001]" "#@#VOCA.inc"][!WriteKeyValue 3T Text "#*[CLC_Num1]*#"][!WriteKeyValue 2T Text "#*[CLC_Num2]*#"][!WriteKeyValue 1T Text "#*[CLC_Num3]*#"][!Redraw][!Refresh]
DynamicVariables=1
[OutPutR2]
Measure=Plugin
Plugin=InputText
DefaultValue=1
Command1=[!WriteKeyValue Variables LogNum [CLC_NumPlus]][!SetVariable LogNum [CLC_NumPlus]][!WriteKeyValue Variables [CLC_Num3] "[AA0002]" "#@#VOCA.inc"][!WriteKeyValue 3T Text "#*[CLC_Num1]*#"][!WriteKeyValue 2T Text "#*[CLC_Num2]*#"][!WriteKeyValue 1T Text "#*[CLC_Num3]*#"][!Redraw][!Refresh]
DynamicVariables=1
[OutPutR3]
Measure=Plugin
Plugin=InputText
DefaultValue=1
Command1=[!WriteKeyValue Variables LogNum [CLC_NumPlus]][!SetVariable LogNum [CLC_NumPlus]][!WriteKeyValue Variables [CLC_Num3] "[AA0003]" "#@#VOCA.inc"][!WriteKeyValue 3T Text "#*[CLC_Num1]*#"][!WriteKeyValue 2T Text "#*[CLC_Num2]*#"][!WriteKeyValue 1T Text "#*[CLC_Num3]*#"][!Redraw][!Refresh]
DynamicVariables=1
-[InputPrograming]-------------------------------------------------------
[CLC_Num1]
Measure=Calc
Formula=(#LogNum#-2)
DynamicVariables=1
[CLC_Num2]
Measure=Calc
Formula=(#LogNum#-1)
DynamicVariables=1
[CLC_Num3]
Measure=Calc
Formula=(#LogNum#)
DynamicVariables=1
[CLC_NumPlus]
Measure=Calc
Formula=(#LogNum#+1)
IfEqualValue=#LogMax#
IfEqualAction=[!WriteKeyValue Variables LogNum 1][!SetVariable LogNum 0][!WriteKeyValue 3T Text "#*-2*#"][!WriteKeyValue 2T Text "#*-1*#"][!WriteKeyValue 1T Text "#*0*#"][!Refresh]
DynamicVariables=1
[1T]
Meter=String
Text=#0#
hidden=1
[2T]
Meter=String
Text=#-1#
hidden=1
[3T]
Meter=String
Text=#-2#
hidden=1
-[Tilte]-------------------------------------------------------------------------------------------------
[Title]
Meter=String
FontSize=18
FontStyle=bold
Text=word arranging
ClipString=1
AntiAlias=1
X=-5
Y=50
[Line]
Meter=String
SolidColor=255,255,255
W=550
H=2
X=0
Y=85
[RefreshButton]
Meter=String
SolidColor=255,255,255,100
x=370
Y=50
W=30
H=30
LeftMouseUpAction=[!Refresh]