It is currently April 16th, 2024, 3:08 pm

trying csv to open ...

Get help with creating, editing & fixing problems with skins
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: trying csv to open ...

Post by eclectic-tech »

Create a disabled second WebParser measure, using the CSV file you read in the first WebParser as the URL, and enable it with a FinishAction.

Use a RegExp in that measure to capture the titles and links (actions); note there are ~104 bits of info so this RegExp will only capture the first 98.

With some modification you could capture separate the CSV 'sections'; 'Accounts', 'Apps', 'Cortana', etc. and then use those as the parents to avoid the 99 StringIndex limit.

Replace [MeasureFile] with this code. It only display the first 5 titles and links in the log, but it captures 98 items. By adding additional [MeasureTitle#] and [MeasureLink#] child measures you can see all the values.

Doing this will get you the link you can use in a mouse action, but in order to use those you would need to create individual meters for the title and link and decide how you want them displayed. That means adding about 200 meters besides the 98 new measures. :Whistle

But hopefully this gives you a starting point.

Code: Select all

[MeasureFile]
Measure=WebParser
; The file should be encoded as UTF-8 or ANSI. If you need to use a
; file that is encoded as UTF-16 LE, Set CodePage=1200 on this measure.

URL="file://#FilePath##FileName#"
RegExp=(?siU)^(.*)$
RegExpSubstitute=1
Substitute="([\t,])":"#TrailingSpaces#[\x0009]","(.{#TrailingSpacesCount#}).*?(\t)":"\1\2"
DynamicVariables=1
StringIndex=1
FinishAction=[!EnableMeasure MeasureLinks][!CommandMeasure MeasureLinks Update]

[MeasureLinks]
Measure=WebParser
URL=[MeasureFile]
RegExp=(?siU).*,Accounts,.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n

.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n.*,,(.*)\t.*,(.*)\n
Disabled=1
FinishAction=[!UpdateMeter MeasureTextHeight]

[MeasureTitle1]
Measure=Webparser
URL=[MeasureLinks]
StringIndex=1

[MeasureLink1]
Measure=Webparser
URL=[MeasureLinks]
StringIndex=2

[MeasureTitle2]
Measure=Webparser
URL=[MeasureLinks]
StringIndex=3

[MeasureLink2]
Measure=Webparser
URL=[MeasureLinks]
StringIndex=4

[MeasureTitle3]
Measure=Webparser
URL=[MeasureLinks]
StringIndex=5

[MeasureLink3]
Measure=Webparser
URL=[MeasureLinks]
StringIndex=6

[MeasureTitle4]
Measure=Webparser
URL=[MeasureLinks]
StringIndex=7

[MeasureLink4]
Measure=Webparser
URL=[MeasureLinks]
StringIndex=8

[MeasureTitle5]
Measure=Webparser
URL=[MeasureLinks]
StringIndex=9

[MeasureLink5]
Measure=Webparser
URL=[MeasureLinks]
StringIndex=10

User avatar
Yincognito
Rainmeter Sage
Posts: 7118
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: trying csv to open ...

Post by Yincognito »

eclectic-tech wrote: September 13th, 2020, 1:50 pmThat means adding about 200 meters besides the 98 new measures. :Whistle
Yep, my point exactly, as mentioned here. This is why I tried to get all the text in a single measure in that thread. For the task there, it was spot on, but naturally if you want to click on each little text you have in the CSV, you must split the file contents into a ton of measures and meters. I try to avoid or alleviate that wherever possible. Rainmeter has the tools to do that, it's just that sometimes it just isn't possible without breaking stuff in order to click on each and every element in a long string.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7118
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: trying csv to open ...

Post by Yincognito »

dvo wrote: September 14th, 2020, 10:00 am it could be eazy just generate it on the line dynamical your on say line 4 then you have just 4 on line 4 and put that in a dynamical in a script generating it all .. that should work for things like this...with auto update on a line by mouse over on a line bg :D


eclectic-tech it's longer than the 300 meter/measures you saw just half of it... it was 264 lines * 2 = 528 meter/measures
ouch...
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7118
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: trying csv to open ...

Post by Yincognito »

dvo wrote: September 14th, 2020, 10:20 am i gonna put it in html and open a windows via a small browser windows that will work to....with no styling it will be 264 lines ... and with some
styling and addon's it could fit it in 300 lines i think... :sly: better then 2112 line i guess..
Yep, that's true. :thumbup:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7118
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: trying csv to open ...

Post by Yincognito »

dvo wrote: September 14th, 2020, 10:33 am and what you were saying it had to be simple not hard to do this ... if html could do it rm should or could do it to...
so more on the background and little in code ...
Yeah, but HTML uses an array of "languages" to accomplish this: HTML, CSS, Javascript. Rainmeter only has the INI format, which was preserved since its inception, on the basis of simplicity and maintaining backward compatibility. Sure, you can do things in Lua for sure, but it's less easy to understand than doing in native code for most folks.

That being said, creating a separate element for each clickable part is done in HTML as well, where you have as many <a>...</a> tags as there are links - so no different from Rainmeter in that regard. The fact that it takes "less" code (debatable, if you look at some HTML page sources) to do that generally has to do with using CSS to store commonly used "styles". Again, you can pretty much do the same in Rainmeter, using the MeterStyle option. As long as the elements are exactly the same visually, you could do it in just 3 lines per element in Rainmeter as well, like:

Code: Select all

[Meter]
Meter=String
MeterStyle=SomeStyle
and have all the rest of the options - written just once - in [SomeStyle]. Sure, you also have the measures to write, but MeterStyle works for measures as well, as far as I know. Not that it would be really needed for WebParser children, as they only take 4 lines:

Code: Select all

[Measure]
Measure=Webparser
URL=[MeasureParent]
StringIndex=N
Bottom line, one has some tools to shorten the code. You only have to use them or use some tricks in order to be able to use them, when using them directly seems impossible (dynamic variables helps in that regard).
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7118
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: trying csv to open ...

Post by Yincognito »

dvo wrote: September 14th, 2020, 11:38 ami think we have to simplify the the use of code not defining all, all the time that it should know that it is and it has the meter and a measure defined in a tag like html has...
Yeah, not possible due to backward compatibility. The devs could probably make it, but then all current skins will become obsolete and have to be rewritten from the ground up. Think of redesigning weather skins but multiplied by thousands at the very least. This format was considered simple and good enough at the start of Rainmeter's development and now we live with the consequences. The good thing is that, as I said, there are solutions to reduce the code length. Not to the level of HTML tags, but much shorter than without any of these solutions being available. :confused:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7118
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: trying csv to open ...

Post by Yincognito »

dvo wrote: September 14th, 2020, 3:28 pm i have allready 2000 lines in dreamweaver but if i make it compact it will be mutch less :P because i can reduce the tables used a lot... :D
creating 6 lines in 1 line so it will improve a lot later the basics are made only have to add the links next to it and the some styles ... ;-)
I hope it's worth all this trouble... :D
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7118
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: trying csv to open ...

Post by Yincognito »

dvo wrote: September 17th, 2020, 10:29 am
Made it with hta and html and some active-x, scripts with buttons and anchors can be opend with hta or rainmeter :D works oke :)

Ms-Setting_1.0.rmskin
Excellent! :thumbup:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth