It is currently May 6th, 2024, 4:15 pm

Using Excel as a Rainmeter Skin

Get help with creating, editing & fixing problems with skins
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Using Excel as a Rainmeter Skin

Post by mak_kawa »

Hi all

I am too late at all... The CSV export-on-save macro is a bit different from what Yincognito wrote, but result is the same.

I wrote the post about it at last night, but too sleepy and went to bed... I curse myself for my slow brain/writing/coding. :-)
User avatar
Yincognito
Rainmeter Sage
Posts: 7206
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Using Excel as a Rainmeter Skin

Post by Yincognito »

mak_kawa wrote: August 28th, 2020, 11:58 pm Hi all

I am too late at all... The CSV export-on-save macro is a bit different from what Yincognito wrote, but result is the same.

I wrote the post about it at last night, but too sleepy and went to bed... I curse myself for my slow brain/writing/coding. :-)
No worries, mak_kawa, your name is already in the list of authors for the skin file, along with jsmorley's and mine. After all, it was your idea to write such a macro. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
JP2K
Posts: 16
Joined: August 28th, 2020, 10:56 am

Re: Using Excel as a Rainmeter Skin

Post by JP2K »

Hello! I was wondering if it would be possible, instead of highlighting if changing of individual blocks would be possible. that way it would be more legible and easier to organize. Could that be done? Even if i have to go through the code to manually do it for each block, it would be a lifesaver.
Also in the first column the last character gets cut off, is it possible to get a fix for that?

Thank you guys so much for all the work being put into this! I am so grateful to you all! :)
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7206
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Using Excel as a Rainmeter Skin

Post by Yincognito »

JP2K wrote: August 28th, 2020, 5:57 pmAlso does skin support highlighting? that would be a very important feature for organizing :)
It would help knowing what do you mean by highlighting and what exactly do you want to highlight...
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
JP2K
Posts: 16
Joined: August 28th, 2020, 10:56 am

Re: Using Excel as a Rainmeter Skin

Post by JP2K »

Yincognito wrote: August 29th, 2020, 7:38 am It would help knowing what do you mean by highlighting and what exactly do you want to highlight...
Sorry about that, ill share a screenshot of what i meant. Either, if possible, changing individual font colors, or highlighting the entire bracket.
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7206
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Using Excel as a Rainmeter Skin

Post by Yincognito »

JP2K wrote: August 29th, 2020, 7:37 amI was wondering if it would be possible, instead of highlighting if changing of individual blocks would be possible. that way it would be more legible and easier to organize. Could that be done? Even if i have to go through the code to manually do it for each block, it would be a lifesaver.
By "blocks" you mean "cells" or "rows" or "columns", right? If so, yes, it is possible, as far as I can tell - I'll post something regarding this later on. The key is to write the appropriate InlineSetting / InlinePattern for it, that's all.
JP2K wrote: August 29th, 2020, 7:37 amAlso in the first column the last character gets cut off, is it possible to get a fix for that?
Well, if you would have read the explanation that I wrote earlier and experiment with it instead of just copy pasting the whole thing, you would have known. :D Simply increase the number of trailing spaces from the [Variables] section (both TrailingSpaces and TrailingSpacesCount) and you're done. For example, set:

Code: Select all

TrailingSpaces="               "
TrailingSpacesCount=15
to have a number of 15 trailing spaces (and a TAB) after each value. What that does is to change the "column width" in your "table" simulation in the skin.

P.S. I see that you didn't remove one of the CSV or TXT save lines from the macro either, as advised. Were you afraid to do it or what? :lol: You have to remember, the key to knowledge is to try things - if you never try something, you'll never know how to do it and always depend on others to serve you with the things you don't know. Just saying... :confused:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
JP2K
Posts: 16
Joined: August 28th, 2020, 10:56 am

Re: Using Excel as a Rainmeter Skin

Post by JP2K »

Yincognito wrote: August 29th, 2020, 8:02 am By "blocks" you mean "cells" or "rows" or "columns", right? If so, yes, it is possible, as far as I can tell - I'll post something regarding this later on. The key is to write the appropriate InlineSetting / InlinePattern for it, that's all.


Well, if you would have read the explanation that I wrote earlier and experiment with it instead of just copy pasting the whole thing, you would have known. :D Simply increase the number of trailing spaces from the [Variables] section (both TrailingSpaces and TrailingSpacesCount) and you're done. For example, set:

Code: Select all

TrailingSpaces="               "
TrailingSpacesCount=15
to have a number of 15 trailing spaces (and a TAB) after each value. What that does is to change the "column width" in your "table" simulation in the skin.

P.S. I see that you didn't remove one of the CSV or TXT save lines from the macro either, as advised. Were you afraid to do it or what? :lol: You have to remember, the key to knowledge is to try things - if you never try something, you'll never know how to do it and always depend on others to serve you with the things you don't know. Just saying... :confused:
Ah i see, that makes more sense! And i simply dont know how to access the macro code thats all. i have the german version so they are called different things, also i am using the 2019 version.. makes things a bit more difficult, but im researching how to access it right now
User avatar
Yincognito
Rainmeter Sage
Posts: 7206
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Using Excel as a Rainmeter Skin

Post by Yincognito »

JP2K wrote: August 29th, 2020, 8:29 am Ah i see, that makes more sense! And i simply dont know how to access the macro code thats all. i have the german version so they are called different things, also i am using the 2019 version.. makes things a bit more difficult, but im researching how to access it right now
Oh, ok - you'll figure it out eventually, just google such things in German and you'll find out.

To color the text exactly as in your screenshots, all you need to do is:
- replace (or comment) the FontColor=#OddColColor# line with FontColor=255,255,255,255 (or whatever you want your "base" text color to be)
- similarly replace or comment:

Code: Select all

InlineSetting=Color | #EvenColColor#
InlinePattern=[^\t]*\t+([^\t]*\t+)
with:

Code: Select all

InlineSetting=Color | 0,112,192,255
InlinePattern=((?:Lunch|Dinner)[^\t\r\n]*[\t\r\n]+)
InlineSetting2=Color | 255,0,0,255
InlinePattern2=(Homework[^\t\r\n]*[\t\r\n]+)
InlineSetting3=Color | 237,125,49,255
InlinePattern3=(Drive[^\t\r\n]*[\t\r\n]+)
InlineSetting4=Color | 0,176,80,255
InlinePattern4=((?:Workout|Running|Coding)[^\t\r\n]*[\t\r\n]+)
to color parts of the string that look like the "patterns" above in a way expressed by the "settings" above, and that's it. Of course, you can add as many InlineSettingN + InlinePatternN (where N is a successively incrementing number, but nothing when 1) pairs as you want and color them appropriately. The (?:a|b) - like patterns basically mean "a OR b" in regex.

I'll post something where you can choose the "cell", "row" or "column" if you need such approaches as well a bit later.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7206
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Using Excel as a Rainmeter Skin

Post by Yincognito »

Yincognito wrote: August 29th, 2020, 9:00 amI'll post something where you can choose the "cell", "row" or "column" if you need such approaches as well a bit later.
A simpler version of the original InlineSetting / InlinePattern pair (which I called "mozaic" - between odd and even columns colors, obviously):

Code: Select all

FontColor=#OddColColor#
InlineSetting=Color | #EvenColColor#
InlinePattern=(?sU).*\t(.*\t)
Then, for coloring specific words, again a simpler version:

Code: Select all

FontColor=255,255,255,255
InlineSetting=Color | 0,112,192,255
InlinePattern=(?U)((?:Lunch|Dinner).*(?:\t|\n))
InlineSetting2=Color | 255,0,0,255
InlinePattern2=(?U)(Homework.*(?:\t|\n))
InlineSetting3=Color | 237,125,49,255
InlinePattern3=(?U)(Drive.*(?:\t|\n))
InlineSetting4=Color | 0,176,80,255
InlinePattern4=(?U)((?:Workout|Running|Coding).*(?:\t|\n))
Words.jpg
For coloring specific rows (the number is the row number, starting at 0):

Code: Select all

FontColor=255,255,255,255
InlineSetting=Color | 255,0,0,255
InlinePattern=(?U)^(?:(?:^|\n).*?){13}((?:^|\n).*?)
Rows.jpg
For coloring specific columns (the number is the column number, starting at 0):

Code: Select all

FontColor=255,255,255,255
InlineSetting=Color | 255,0,0,255
InlinePattern=(?U)(?:^|\n)(?:.*\t){4}(.*(?=\t|\n|\$))
Columns.jpg
For coloring specific cells (the 1st number is the row number, the 2nd number is the column number, both starting at 0):

Code: Select all

FontColor=255,255,255,255
InlineSetting=Color | 255,0,0,255
InlinePattern=(?U)^(?:(?:^|\n).*?){11}(?:^|\n)(?:.*\t){3}(.*(?=\t|\n|\$))
Cells.jpg
You place any of these in the [MeterFile] meter from the skin code I posted earlier, replacing (or commenting) the existing similar options.

References:
1) Inline Options (for info about the InlineSetting and InlinePattern options in String meters)
2) RegExr (for info about Regular Expressions and testing them - check RegEx Reference in the Menu on the left)
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
JP2K
Posts: 16
Joined: August 28th, 2020, 10:56 am

Re: Using Excel as a Rainmeter Skin

Post by JP2K »

Yincognito wrote: August 29th, 2020, 12:52 pm A simpler version of the original InlineSetting / InlinePattern pair (which I called "mozaic" - between odd and even columns colors, obviously):

Code: Select all

FontColor=#OddColColor#
InlineSetting=Color | #EvenColColor#
InlinePattern=(?sU).*\t(.*\t)
Then, for coloring specific words, again a simpler version:

Code: Select all

FontColor=255,255,255,255
InlineSetting=Color | 0,112,192,255
InlinePattern=(?U)((?:Lunch|Dinner).*(?:\t|\n))
InlineSetting2=Color | 255,0,0,255
InlinePattern2=(?U)(Homework.*(?:\t|\n))
InlineSetting3=Color | 237,125,49,255
InlinePattern3=(?U)(Drive.*(?:\t|\n))
InlineSetting4=Color | 0,176,80,255
InlinePattern4=(?U)((?:Workout|Running|Coding).*(?:\t|\n))
Words.jpg
For coloring specific rows (the number is the row number, starting at 0):

Code: Select all

FontColor=255,255,255,255
InlineSetting=Color | 255,0,0,255
InlinePattern=(?U)^(?:(?:^|\n).*?){13}((?:^|\n).*?)
Rows.jpg
For coloring specific columns (the number is the column number, starting at 0):

Code: Select all

FontColor=255,255,255,255
InlineSetting=Color | 255,0,0,255
InlinePattern=(?U)(?:^|\n)(?:.*\t){4}(.*(?=\t|\n|\$))
Columns.jpg
For coloring specific cells (the 1st number is the row number, the 2nd number is the column number, both starting at 0):

Code: Select all

FontColor=255,255,255,255
InlineSetting=Color | 255,0,0,255
InlinePattern=(?U)^(?:(?:^|\n).*?){11}(?:^|\n)(?:.*\t){3}(.*(?=\t|\n|\$))
Cells.jpg
You place any of these in the [MeterFile] meter from the skin code I posted earlier, replacing (or commenting) the existing similar options.

References:
1) Inline Options (for info about the InlineSetting and InlinePattern options in String meters)
2) RegExr (for info about Regular Expressions and testing them - check RegEx Reference in the Menu on the left)
You are amazing dude!!! Thank you so much for this feature! Thanks to everyone working on this, it means the world to me! Also taught me some useful stuff ;)