It is currently April 18th, 2024, 3:43 am

Creating Rainmeter Notification Application

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Creating Rainmeter Notification Application

Post by jsmorley »

So you could do something like this:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
OnRefreshAction=[!Hide]

[Variables]
DelaySeconds=10
LatestTime=0

[MeasureFile]
Measure=WebParser
URL=file://#CURRENTPATH#Test.json
RegExp=(?siU)"title": "(.*)".*"updated_at": "(.*)"
FinishAction=[!EnableMeasureGroup Times][!UpdateMeasureGroup Times]

[MeasureTile]
Measure=WebParser
URL=[MeasureFile]
StringIndex=1

[MeasureTime]
Measure=WebParser
URL=[MeasureFile]
StringIndex=2

[MeasureTestTime]
Measure=Time
Group=Times
TimeStamp=[MeasureTime]
TimeStampFormat=%m/%d/%Y %H:%M
Disabled=1
DynamicVariables=1
UpdateDivider=-1
IfCondition=[MeasureTestTime:timestamp] > #LatestTime#
IfTrueAction=[!WriteKeyValue Variables LatestTime "[MeasureTestTime:timestamp]"][!SetVariable LatestTime "[MeasureTestTime:timestamp]"][!ShowMeterGroup AllMeters][!Delay 1000][!ShowFade][!EnableMeasure MeasureSeconds]

[MeasureSeconds]
Measure=Calc
Formula=MeasureSeconds + 1
IfCondition=MeasureSeconds = #DelaySeconds#
IfTrueAction=[!HideFade][!Delay 1000][!HideMeterGroup AllMeters][!DisableMeasure MeasureSeconds]
Disabled=1
DynamicVariables=1

[MeterAlertPanel]
Meter=Shape
Group=AllMeters
Shape=Rectangle 1.5,1.5,300,50,12 | StrokeWidth 1.5 | Stroke Color 150,150,150,255 | Fill Color 47,47,47,255
Hidden=1

[MeterTitle]
Meter=String
Group=AllMeters
MeasureName=MeasureTile
X=10
Y=17
W=260
ClipString=1
FontSize=13
FontWeight=400
FontColor=255,255,255,255
AntiAlias=1
Hidden=1

[MeterClose]
Meter=String
Group=AllMeters
X=290
Y=10
StringAlign=Right
FontSize=13
FontWeight=400
FontColor=255,255,255,255
SolidColor=60,60,60,255
Padding=5,5,5,5
AntiAlias=1
Text=[\x274C]
Hidden=1
MouseOverAction=[!SetOption MeterClose SolidColor "154,17,0,255"][!UpdateMeter MeterClose][!Redraw]
MouseLeaveAction=[!SetOption MeterClose SolidColor "60,60,60,255"][!UpdateMeter MeterClose][!Redraw]
LeftMouseUpAction=[!HideFade][!Delay 1000][!HideMeterGroup AllMeters][!DisableMeasure MeasureSeconds]
GIF.gif
You can test this by editing the skin and changing the variable LatestTime to 0, saving and refreshing. that will show the popup panel, that will be there for 10 seconds or until the "X" is clicked to dismiss it.

The key to this is the measure [MeasureSeconds], which when enabled will count to 10 and take some action.

I didn't put any real work into cosmetics, that's up to you and your creativity...
You do not have the required permissions to view the files attached to this post.
mobileqa
Posts: 32
Joined: March 26th, 2018, 1:09 pm

Re: Creating Rainmeter Notification Application

Post by mobileqa »

Thanks, I will test it out, and let you know the results.
mobileqa
Posts: 32
Joined: March 26th, 2018, 1:09 pm

Re: Creating Rainmeter Notification Application

Post by mobileqa »

When I load the code the rainmeter application doesn't show. I just copy/pasted into new file and loaded.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Creating Rainmeter Notification Application

Post by eclectic-tech »

mobileqa wrote:When I load the code the rainmeter application doesn't show. I just copy/pasted into new file and loaded.
Check the encoding of your json file; it should be ANSI... if it is a different encoding you can add CodePage to the measure to match the file encoding.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Creating Rainmeter Notification Application

Post by jsmorley »

mobileqa wrote:When I load the code the rainmeter application doesn't show. I just copy/pasted into new file and loaded.
What is showing in About / Log when you refresh it?
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Creating Rainmeter Notification Application

Post by jsmorley »

eclectic-tech wrote:Check the encoding of your json file; it should be ANSI... if it is a different encoding you can add CodePage to the measure to match the file encoding.
Strictly speaking, the .json file encoding should be UTF-8 with or without BOM for WebParser. ANSI will work, since in a sense is just UTF-8 w/o BOM. ANSI gets trickier when you have something that is specifically looking for ASCII / Extended ASCII, but that is a different discussion.

mobileqa, are you sure you created the UTF-8 encoded Test.json file in the same folder as the skin, OR changed the URL in the test code to point to your remote .json file?
mobileqa
Posts: 32
Joined: March 26th, 2018, 1:09 pm

Re: Creating Rainmeter Notification Application

Post by mobileqa »

I get this
NOTE (09:11:20.743) illustro\Notify\Notify.ini: Refreshing skin
ERRO (09:11:20.773) illustro\Notify\Notify.ini - [MeasureFile]: RegExp matching error (-1)
ERRO (09:11:20.774) illustro\Notify\Notify.ini - [MeasureTestTime]: Invalid TimeStampFormat: %m/%d/%Y %H:%M
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Creating Rainmeter Notification Application

Post by jsmorley »

mobileqa wrote:I get this
NOTE (09:11:20.743) illustro\Notify\Notify.ini: Refreshing skin
ERRO (09:11:20.773) illustro\Notify\Notify.ini - [MeasureFile]: RegExp matching error (-1)
ERRO (09:11:20.774) illustro\Notify\Notify.ini - [MeasureTestTime]: Invalid TimeStampFormat: %m/%d/%Y %H:%M

Post the skin code...
mobileqa
Posts: 32
Joined: March 26th, 2018, 1:09 pm

Re: Creating Rainmeter Notification Application

Post by mobileqa »

Thanks to your code example I got my application to work. I implemented the Time calculations, and my skin now reads the timestamp and show the skin if changes are made
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Creating Rainmeter Notification Application

Post by jsmorley »

Cool.