It is currently April 25th, 2024, 2:18 pm

[Beginner] Change Meterstyle via Conditions

Get help with creating, editing & fixing problems with skins
User avatar
Colorado
Posts: 18
Joined: July 18th, 2019, 5:06 pm

Re: [Beginner] Change Meterstyle via Conditions

Post by Colorado »

Alex88 wrote: October 20th, 2020, 11:27 pm The [Variables] section here is just for this example to work. if the variables are already previously defined, you don't need to include it, and try changing the variables in where its defined in Gcal.

Click
dogExample2.gif
Yeah it must have to do with source.
Is there any way to search for a string within the specified string?
I feel like something larger is happening, so maybe it's not just "Dog" originally.

Some line of code to basically say "regardless of how big Title1Name was on import from Google Calendar, was 'Dog' in there"?
Learnin some Rainmeter I guess :uhuh:
User avatar
Alex88
Posts: 92
Joined: July 18th, 2020, 1:23 am
Location: California

Re: [Beginner] Change Meterstyle via Conditions

Post by Alex88 »

Colorado wrote: October 20th, 2020, 11:34 pm Is there any way to search for a string within the specified string?
Referring to how [MeasureDateColor] with IfMatchAction works, having IfMatch=dog means it's already looks for the literal and case-sensitive dog anywhere within the string (and not Dog) of what #Item1TItle# is, and returns true or false if it finds it or not.
Check if you're using dog or Dog, and the examples in the above IfMatchAction hyperlink are good to see how the search string affects what is found. Otherwise, since If it has to do with outside files, then it's best to make a .rmksin or .zip all included files and post it here.
User avatar
Colorado
Posts: 18
Joined: July 18th, 2019, 5:06 pm

Re: [Beginner] Change Meterstyle via Conditions

Post by Colorado »

Alex88 wrote: October 20th, 2020, 11:56 pm Referring to how [MeasureDateColor] with IfMatchAction works, having IfMatch=dog means it's already looks for the literal and case-sensitive dog anywhere within the string (and not Dog) of what #Item1TItle# is, and returns true or false if it finds it or not.
Check if you're using dog or Dog, and the examples in the above IfMatchAction hyperlink are good to see how the search string affects what is found. Otherwise, since If it has to do with outside files, then it's best to make a .rmksin or .zip all included files and post it here.
Thank you for all your help so far.
Here is the .zip.
It has Images / Measures / the .ini (that this thread references) ...
https://filebin.net/sgjjiflmybthgv7u
Learnin some Rainmeter I guess :uhuh:
User avatar
balala
Rainmeter Sage
Posts: 16169
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Beginner] Change Meterstyle via Conditions

Post by balala »

Colorado wrote: October 20th, 2020, 9:08 pm

Code: Select all

        [ItemWhat2]
	Meter=STRING
	X=56
	Y=70
	H=25
	W=(#SidebarWidth# * 0.65)
	Group=FeedData
	
	Text=#Item2Title#                          ; This is the string that should guide the conditional statement.
        MeterStyle=StyleReaderSubtext              ; This needs some conditional statement to select which style. **
	

	[StyleReaderSubtext]
	X=12
	Y=5r
	H=14
	W=(#SidebarWidth#-0)
	ClipString=1
	StringStyle=BOLD
	StringEffect=Shadow
	FontColor=216, 27, 96
Didn't read all the topic, but sawing the above code I have to make a comment. In Rainmeter, unlike in programming languages (which Rainmeter isn't), it's a much better idea not to add the comments into the same line as the option. Comments have to be done in distinct lines, which has to be started with the semicolon. For instance the above Text=#Item2Title# ; This is the string that should guide the conditional statement. option will result in showing on the skin not just the value of the #Item2Title# variable, but the comment as well. The correct approach of these two lines would be:

Code: Select all

Text=#Item2Title#
; This is the string that should guide the conditional statement.
Details: https://forum.rainmeter.net/viewtopic.php?f=5&t=27443&p=142422&p142422#p142422
As said above, Rainmeter is not a procedural programming language, that's why you can't use comments this way.
User avatar
Colorado
Posts: 18
Joined: July 18th, 2019, 5:06 pm

Re: [Beginner] Change Meterstyle via Conditions

Post by Colorado »

balala wrote: October 21st, 2020, 4:12 pm Didn't read all the topic, but sawing the above code I have to make a comment. In Rainmeter, unlike in programming languages (which Rainmeter isn't), it's a much better idea not to add the comments into the same line as the option. Comments have to be done in distinct lines, which has to be started with the semicolon. For instance the above Text=#Item2Title# ; This is the string that should guide the conditional statement. option will result in showing on the skin not just the value of the #Item2Title# variable, but the comment as well. The correct approach of these two lines would be:

Code: Select all

Text=#Item2Title#
; This is the string that should guide the conditional statement.
Details: https://forum.rainmeter.net/viewtopic.php?f=5&t=27443&p=142422&p142422#p142422
As said above, Rainmeter is not a procedural programming language, that's why you can't use comments this way.
Gotcha.
Sorry, but at no point did I add comments to the code. This was purely for my question.
I've removed from the OP.

I need help with the file as to why #Item1Title# isn't working in the conditional statements as intended:
https://filebin.net/sgjjiflmybthgv7u
Learnin some Rainmeter I guess :uhuh:
User avatar
balala
Rainmeter Sage
Posts: 16169
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Beginner] Change Meterstyle via Conditions

Post by balala »

Colorado wrote: October 21st, 2020, 6:01 pm I need help with the file as to why #Item1Title# isn't working in the conditional statements as intended:
https://filebin.net/sgjjiflmybthgv7u
Your code is working. But note that there are two [Variables] sections. In the first one there are a lot of variables (among others Item1Title is empty), in the second one only two variables: SidebarWidth and Item1Title (set to abcd). Neither this value of the Item1Title variable, nor the SidebarWidth=100 value of SidebarWidth variable are not used. The Rainmeter codes (in fact in .ini files) can't use the second occurrence of a variable, section or whatever. Only one of any of this elements are allowed.
User avatar
Colorado
Posts: 18
Joined: July 18th, 2019, 5:06 pm

Re: [Beginner] Change Meterstyle via Conditions

Post by Colorado »

balala wrote: October 21st, 2020, 7:05 pm Your code is working. But note that there are two [Variables] sections. In the first one there are a lot of variables (among others Item1Title is empty), in the second one only two variables: SidebarWidth and Item1Title (set to abcd). Neither this value of the Item1Title variable, nor the SidebarWidth=100 value of SidebarWidth variable are not used. The Rainmeter codes (in fact in .ini files) can't use the second occurrence of a variable, section or whatever. Only one of any of this elements are allowed.
So what can I do in this situation?

The loader code is beyond what I understand....
So if I go in there and change the Gcalendar grabber...
The whole skin will come undone

Gah I think this is beyond me at this point
Learnin some Rainmeter I guess :uhuh:
User avatar
balala
Rainmeter Sage
Posts: 16169
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Beginner] Change Meterstyle via Conditions

Post by balala »

Colorado wrote: October 21st, 2020, 10:06 pm So what can I do in this situation?
Not entirely sure, because it depends. First try to remove the second occurrence of the [Variables] section and rewrite the Item1Title variable to abcd (Item1Title=abcd) in the remaining [Variables] section. did this help?