Hello, it is true that it works but there was an error in the syntax of the code that sends the data of the Second Variable that I did not show in the initial post and that contains the web address of Google/Gmail
Code: Select all
[Variables]
@Include=#@#UserVariables.inc
@Include2=#@#Variables.inc
@Include3=#@#Translation.inc
Hide01=0
Hide02=1
Hide03=1
Hide04=1
;Variable to disable or enable Measures
Mail01-State=1
Mail02-State=1
;Variables to know if there is a user and password defined 0=Not Defined, 1=Defined
Mail01-User=0
Mail01-Pass=0
Mail02-User=0
Mail02-Pass=0
;Declare Variable to open mail client
WEBmail=http://mail.google.com/mail/ ;<-- (This Variable is not declared here it is in the UserVariables.inc file)
MailClient=0
.......
[mCheckMail-MailClient]
Measure=String
String=#Mail#
RegExpSubstitute=1
Substitute="^(.+)$":"enabled","^$":"disabled"
IfMatch="enabled"
IfMatchAction=[!Log "Mail client is configured" Notice][!SetVariable "MailClient" "#Mail#"]
IfNotMatchAction=[!Log "No Mail client is configured" Notice][!SetVariable MailClient "[#WEBmail#]"]
UpdateDivider=-1
DynamicVariables=1
......
[Mail01Count]
Meter=String
MeterStyle=Text
MeasureName=mMail01
X=50
Y=5
W=60
H=30
FontFace=#Primary Font#
FontColor=#Secondary Font Color#
FontSize=20
StringStyle=Bold
LeftMouseUpAction=[!SetVariable Hide01 1] [!SetVariable Hide02 0] [!SetVariable Hide03 0] [!SetVariable Hide04 1]
RightMouseDownAction=#MailClient#
DynamicVariables=1
Now The
MailClient Variable always holds the correct syntax in any situation, good explanation of why all these checks on whether or not the
Mail Variable has data.
Not only do I check that variable, I also check User and Pass of
mCheckMail01,
mCheckMail02,
mCheckInternet because I am debugging errors that appear in the LOG of this Skin that checks Gmail.
And since I only want it to check the mail under certain conditions, that's why I check the UserVariables previously and Internet, the Skin will only check the mail if everything is fine and it will not do it if there is a missing data, also the Measures that check the start mail are deactivated and are only activated as I say if the User data is correct.
I enable the Measurement group with this code after the previous checks:
Code: Select all
[mCheckInternet]
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
IfCondition=(mCheckInternet = -1)
IfTrueAction=[!Log "No Internet available" Notice][!SetVariable Mail01-State "1"][!SetVariable Mail02-State "1"]
IfCondition2=(mCheckInternet = 1) && (#Mail01-User# = 1) && (#Mail01-Pass# = 1)
IfTrueAction2=[!Log "Mail01 update possible" Notice][!SetVariable Mail01-State "0"][!EnableMeasureGroup "MeasureMail01"][!UpdateMeasureGroup "MeasureMail01"]
IfCondition3=(mCheckInternet = 1) && (#Mail02-User# = 1) && (#Mail02-Pass# = 1)
IfTrueAction3=[!Log "Mail02 update possible" Notice][!SetVariable Mail02-State "0"][!EnableMeasureGroup "MeasureMail02"][!UpdateMeasureGroup "MeasureMail02"]
DynamicVariables=1
[!EnableMeasureGroup "MeasureMail01"][!UpdateMeasureGroup "MeasureMail01"] , Is there another better way to enable and update them with
!EnableMeasureGroup !UpdateMeasureGroup ???, Is it correct to use this code to update the Measures?