It is currently December 12th, 2019, 8:16 pm

NowPlaying Measure Can't Display Special Characters From MediaMonkey

Get help with installing and using Rainmeter.
Technotastic
Posts: 21
Joined: November 16th, 2019, 3:50 pm

Re: NowPlaying Measure Can't Display Special Characters From MediaMonkey

Technotastic » November 18th, 2019, 3:52 am

I'm almost there! Just a few more questions! The path to the skin folder has a space in it. How do I get WebParser to read the path correctly?
User avatar
Yamajac
Posts: 132
Joined: June 30th, 2014, 8:44 am

Re: NowPlaying Measure Can't Display Special Characters From MediaMonkey

Yamajac » November 18th, 2019, 3:59 am

Technotastic wrote:
November 18th, 2019, 3:52 am
I'm almost there! Just a few more questions! The path to the skin folder has a space in it. How do I get WebParser to read the path correctly?
Url=file://C:\Users\Charlotte\Documents\Rainmeter\Skins\MMNow Playing\tester.txt

Works for me. Double check that the path is correct.
Technotastic
Posts: 21
Joined: November 16th, 2019, 3:50 pm

Re: NowPlaying Measure Can't Display Special Characters From MediaMonkey

Technotastic » November 18th, 2019, 4:02 am

My path had a typo. I am so sorry. Now it is giving me a RegEx error. Attempting to fix it now.

EDIT: I can't seem to fix this one either. It keeps telling me "RegExp matching error (-1)" despite my expression being coded correctly.

Code: Select all

RegExp=(?siU)<artist>(.*)</artist>
This is correct, yes? Why am I being thrown an error?
Technotastic
Posts: 21
Joined: November 16th, 2019, 3:50 pm

Re: NowPlaying Measure Can't Display Special Characters From MediaMonkey

Technotastic » November 18th, 2019, 4:16 am

Reading other posts I think it has something to do with the file structure once again, but I'm not certain. I've tried moving the file around but it doesn't seem to do anything. I am yet again at an impasse. I am very sorry that my level of knowledge and problem solivng is this low.

EDIT: The path doesn't seem to the be the issue. The error log is talking about the RegEx expression, which means that the file path should be resolved. I still do not know why the RegEx expression is throwing an error though. My file's formatting has not changed, the tags I am telling the expression to search for are present in the file.
Last edited by Technotastic on November 18th, 2019, 4:21 am, edited 1 time in total.
User avatar
Yamajac
Posts: 132
Joined: June 30th, 2014, 8:44 am

Re: NowPlaying Measure Can't Display Special Characters From MediaMonkey

Yamajac » November 18th, 2019, 4:19 am

Technotastic wrote:
November 18th, 2019, 4:16 am
Reading other posts I think it has something to do with the file structure once again, but I'm not certain. I've tried moving the file around but it doesn't seem to do anything. I am yet again at an impasse. I am very sorry that my level of knowledge and problem solivng is this low.
If you could upload the skin folder with the NowPlaying.txt I could take a look at it.

I imagine it's because you need to add .*? before <artist> though.
Technotastic
Posts: 21
Joined: November 16th, 2019, 3:50 pm

Re: NowPlaying Measure Can't Display Special Characters From MediaMonkey

Technotastic » November 18th, 2019, 4:24 am

By all means, have a look. I tried doing as you suggested, but it didn't do anything. It's entirely possible I did it wrong though. Thank you so much for your continued patience.
You do not have the required permissions to view the files attached to this post.
User avatar
Yamajac
Posts: 132
Joined: June 30th, 2014, 8:44 am

Re: NowPlaying Measure Can't Display Special Characters From MediaMonkey

Yamajac » November 18th, 2019, 4:59 am

Technotastic wrote:
November 18th, 2019, 4:24 am
By all means, have a look. I tried doing as you suggested, but it didn't do anything. It's entirely possible I did it wrong though. Thank you so much for your continued patience.
Ah.

Add codepage=1200 to the parent web parser measure.
Technotastic
Posts: 21
Joined: November 16th, 2019, 3:50 pm

Re: NowPlaying Measure Can't Display Special Characters From MediaMonkey

Technotastic » November 18th, 2019, 5:03 am

Yamajac wrote:
November 18th, 2019, 4:59 am
Ah.

Add codepage=1200 to the parent web parser measure.
It worked! Please give me one moment to bring everything together.
Technotastic
Posts: 21
Joined: November 16th, 2019, 3:50 pm

Re: NowPlaying Measure Can't Display Special Characters From MediaMonkey

Technotastic » November 18th, 2019, 6:05 am

EVERYTHING FINALLY WORKS!!!!

I want to thank forum users Balala and Yamajac for providing me with the insight, support, and ultimately the solution to this issue. For posterity, here is the complete method you have to use in order to get special characters to display in MediaMonkey 4.1:

1. Locate your "scripts" folder inside your Media Monkey program files.

2. Download the attached script (OutputTextFile), and make sure you change the extention from .txt to .vbs (Save As -> Click the "Save as Type" dropdown -> select "all files" -> append .vbs to the file name -> click "Save")

3. Set the path inside the script to lead to the root folder of whatever skin is displaying your music information (monstercat-visualizer, in my case), then save and close it.

4. Put the script inside your Media Monkey "scripts" folder. Do NOT put it in the "auto" folder or any other sub-folders. Drop it right into that scripts folder, nowhere else.

5. Inside the scripts folder, open scripts.ini and navigate to the bottom of the file. There, you'll need to copy paste this chunk of code:

Code: Select all

[OutputTextFile]
FileName=OutputTextFile.vbs
ProcName=OutputTextFile
Language=VBScript
ScriptType=2
6. Save scripts.ini, and close it.

7. Test run the script. This is to ensure Media Monkey has the permissions it needs to run your script correctly. If it works, and you find your text file in the folder you specified, continue to step 9, otherwise continue to step 8.

8. If your script is giving you a "No Permission" error, or any error related to execution permissions, navigate to your Media Monkey program files folder. Select the folder. Right click, then left click properties. Go to the security tab. Hit the button that says "Edit...". Step through each of the listed entities (CREATOR OWNER, Users, etc.), and grant them "Full control". Once this is done, run your script again and you shouldn't have any permission based issues.

9. Now that your script is running correctly, you're done with the MediaMonkey bit. Now you have to do the Rainmeter bit. Figure out where the code responsible for displaying all your media information in the skin you're trying to modify.

10. It's counter-intuitive, but in order to guarantee that your code substitution works, we're gonna do the modification in the file containing the final meter(s), NOT wherever the original measures are coming from.

11. Now you're going to need to make your parent WebParser measure. I suggest doing all of the following steps at the top of the file, just under the [Rainmeter], [Metadata] and [Variables] sections. Here's my template:

Code: Select all

[MeasurePlayingFile]
Measure=WebParser
URL=file://PATH TO TEXT FILE GOES HERE
RegExp=(?siU)<artist>(.*)</artist>.*<track>(.*)</track>.*<album>(.*)</album>
UpdateRate=10
Codepage=1200
12. Now set up your child measures. Here are my templates:

Code: Select all

[MeasureArtistMM]
Measure=WebParser
URL=[MeasurePlayingFile]
StringIndex=1

[MeasureTrackMM]
Measure=WebParser
URL=[MeasurePlayingFile]
StringIndex=2
I haven't added in the album field for this example, since the meter I've personally frankenstein'ed doesn't support a third info field natively. If you want to include it, go for it, you should be able to extrapolate from this guide.

13. Now that your measures are all set up, go find the meter(s) that are ultimately displaying your media information. Find the measures they're currently using, and replace them with the measures we've just set up here. This shouldn't be too hard, since you're (supposed to be) doing all this in the same file.

14. Save everything, refesh all meters involved. Fire up Media Monkey and smash play on whatever hot new Japanese Future Funk album you've purchased. Check your skin, make sure it's processing everything correctly AND updating an acceptable speed when you change tracks.

With luck, you're going to see some beautiful Japanese sitting right there on your desktop. Right where it belongs. If I missed a step or forgot anything, please bump this thread. Let me know.

Credits:

The original version of the MediaMonkey script OutputTextFile was originally written by MediaMonkey forum user parkint in 2004, and remade by MediaMonkey forum user kireev20000 in 2016. The original thread containing the original script code can be found here.

The issues with NowPlaying as a measure for MediaMonkey were discovered by Rainmeter forum user balala, which can be found here.

All of the coding needed to acutally make my trashy web parsing work was provided by Rainmeter forums user Yamajac, in this thread.

Conclusion:
This was a wild three day ride, and it seems fitting that I'm writing the conclusion to it at 1AM. Thanks to the support of forum users past and present, as well as documentation from across the web made by who knows how many kind souls, I have finally put this issue to rest. Special characters now display as just that, special characters. One last massive thank you yet again to the patient folks who helped me out with this. Hopefully this post will pay it foward to somebody down the road who wants this same problem fixed.

Cheers,

Technotastic
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 19864
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: NowPlaying Measure Can't Display Special Characters From MediaMonkey

jsmorley » November 18th, 2019, 11:29 am

Yamajac wrote:
November 18th, 2019, 3:36 am
Sorry, I got distracted working on a context menu skin and completely forgot I was helping you. Another thing I totally forgot about, but WebParser can only read files within the Skins directory. So just put the NowPlaying.txt in your MMNowPlaying folder. I believe you can make a symlink as well, but it's gotta be somewhere in the Skins directory.
Just to be clear, WebParser can read from any folder. !WriteKeyValue is limited to the Skins\ folder.