Is it possible to implement FinishAction on "child" WebParser measures? The reason is because sometimes I use WebParser to parse through a long list, and before WebParser sets each StringIndex in the "child" measures, the FinishAction gets called on the "parent" measure sometimes resulting in display errors.
I think it would be nice to be able to use FinishAction on a specific "child" measure so I know that the value is set before performing some action.
Hope that makes sense.
-Brian
It is currently May 5th, 2024, 11:33 pm
[Suggestion] FinishAction on Child WebParser Measures
-
- Developer
- Posts: 2689
- Joined: November 24th, 2011, 1:42 am
- Location: Utah
[Suggestion] FinishAction on Child WebParser Measures
Last edited by Brian on January 9th, 2012, 11:54 pm, edited 1 time in total.
-
- Posts: 366
- Joined: November 12th, 2009, 4:47 pm
- Location: Ukraine
Re: [Suggestion]FinishAction on Child WebParser Measures
Pls, look at example http://rainmeter.net/forum/viewtopic.php?f=15&t=10844 ( it uses child measure and FinishAction in it)Brian wrote:Is it possible to implement FinishAction on "child" WebParser measures?
Is that what you need?
-
- Developer
- Posts: 2689
- Joined: November 24th, 2011, 1:42 am
- Location: Utah
Re: [Suggestion]FinishAction on Child WebParser Measures
hmmm. Maybe its just me. I have tried to use FinishAction in "child" measures before with no luck, so I just assumed it only worked with the "parent" measure since that is where the downloading takes place.
If I can replicate the problem, I will post it.
-Brian
If I can replicate the problem, I will post it.
-Brian
-
- Developer
- Posts: 2689
- Joined: November 24th, 2011, 1:42 am
- Location: Utah
Re: [Suggestion]FinishAction on Child WebParser Measures
Ok, I think I can show you what I mean.
Consider this code:This grabs the first image on the main site, and the current version number. The picture displays just fine (so, FinishAction works), BUT the version does not display.
My first assumption was that the picture was "on top" of the text, so I commented out the line: FinishAction=!ShowMeter DisplayPicture. The Version still does not display.
Next, I uncomment out the FinishAction=!ShowMeter DisplayPicture, and comment out this: Hidden=1 in [DisplayVersion]. This time, the picture comes up, and the version......so, my thinking is FinishAction did not work correctly. I believe [Version] is the only true "child" measure in this example.
-Brian
Consider this code:
Code: Select all
[Website]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=http://rainmeter.net/cms
UpdateRate=3600
RegExp="(?siU)<img src="(.*)".*<h2>Download</h2>.*<b>(.*)</b>"
[Picture]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=http://rainmeter.net[Website]
Download=1
FinishAction=!ShowMeter DisplayPicture
StringIndex=1
[Version]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[Website]
FinishAction=!ShowMeter DisplayVersion
StringIndex=2
[DisplayPicture]
Meter=Image
MeasureName=Picture
X=0
Y=0
Hidden=1
[DisplayVersion]
Meter=String
MeasureName=Version
X=0
Y=0
FontColor=255,255,255
SolidColor=0,0,0,1
Hidden=1
My first assumption was that the picture was "on top" of the text, so I commented out the line: FinishAction=!ShowMeter DisplayPicture. The Version still does not display.
Next, I uncomment out the FinishAction=!ShowMeter DisplayPicture, and comment out this: Hidden=1 in [DisplayVersion]. This time, the picture comes up, and the version......so, my thinking is FinishAction did not work correctly. I believe [Version] is the only true "child" measure in this example.
-Brian
-
- Posts: 366
- Joined: November 12th, 2009, 4:47 pm
- Location: Ukraine
Re: [Suggestion]FinishAction on Child WebParser Measures
try add "#CURRENTCONFIG#" to all FinishActionBrian wrote:Ok, I think I can show you what I mean.
Consider this code:This grabs the first image on the main site, and the current version number. The picture displays just fine (so, FinishAction works), BUT the version does not display.Code: Select all
[Website] Measure=Plugin Plugin=Plugins\WebParser.dll URL=http://rainmeter.net/cms UpdateRate=3600 RegExp="(?siU)<img src="(.*)".*<h2>Download</h2>.*<b>(.*)</b>" [Picture] Measure=Plugin Plugin=Plugins\WebParser.dll URL=http://rainmeter.net[Website] Download=1 FinishAction=!ShowMeter DisplayPicture StringIndex=1 [Version] Measure=Plugin Plugin=Plugins\WebParser.dll URL=[Website] FinishAction=!ShowMeter DisplayVersion StringIndex=2 [DisplayPicture] Meter=Image MeasureName=Picture X=0 Y=0 Hidden=1 [DisplayVersion] Meter=String MeasureName=Version X=0 Y=0 FontColor=255,255,255 SolidColor=0,0,0,1 Hidden=1
My first assumption was that the picture was "on top" of the text, so I commented out the line: FinishAction=!ShowMeter DisplayPicture. The Version still does not display.
Next, I uncomment out the FinishAction=!ShowMeter DisplayPicture, and comment out this: Hidden=1 in [DisplayVersion]. This time, the picture comes up, and the version......so, my thinking is FinishAction did not work correctly. I believe [Version] is the only true "child" measure in this example.
-Brian
like this,
Code: Select all
FinishAction=!ShowMeter DisplayPicture "#CURRENTCONFIG#"
-
- Developer
- Posts: 2689
- Joined: November 24th, 2011, 1:42 am
- Location: Utah
Re: [Suggestion]FinishAction on Child WebParser Measures
No effect when adding "#CURRENTCONFIG#" to all FinishActions.
-Brian
-Brian
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: [Suggestion]FinishAction on Child WebParser Measures
Yes, I have never known "FinishAction" to work on a "child" WebParser measure, only on a "parent" one. It is fired by WebParser when it "finishes retrieving information from the website", and is not a general purpose action upon completion of the measure. The [Picture] measure does in fact go out to the website to get the image, so the FinishAction is fired.
I would be fine in principle with making FinishAction work on "child" measures if it is possible without drastic changes to WebParser. Although I must say, "child" measures are very dependent on the "parent" going out to a website to get new information, and I'm not sure I see the point, as you can put as many FinishAction "actions" on the parent as you like. Seems to me that it is more cosmetic than anything else to put FinishActions on separate "child" measures.
In any case, for now, I think the rule is just that it only works on "parent" measures. It is due to the fact that the function was written in conjunction with the routines that go out to a website. "Child" measures do not.
I would be fine in principle with making FinishAction work on "child" measures if it is possible without drastic changes to WebParser. Although I must say, "child" measures are very dependent on the "parent" going out to a website to get new information, and I'm not sure I see the point, as you can put as many FinishAction "actions" on the parent as you like. Seems to me that it is more cosmetic than anything else to put FinishActions on separate "child" measures.
In any case, for now, I think the rule is just that it only works on "parent" measures. It is due to the fact that the function was written in conjunction with the routines that go out to a website. "Child" measures do not.