Custom Report 3.2 - Updated 29/07/2014

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Custom Report 3.2 - Updated 29/07/2014

Post by trixmoto »

This script allows the user to define their own reports. First choose the format and filename of the report. Then add columns and order them as you please. You can define the column headings and also format the data as you please.

The field formats can be separated with spaces to apply multiple formats to one field. For example, to surround a value with brackets use the format P( S).

As always to installer is available from my website. :)

Code: Select all

'
' MediaMonkey Script
'
' NAME: CustomReport 3.2
'
' AUTHOR: trixmoto (http://trixmoto.net)
' DATE : 29/07/2014
'
' INSTALL: Copy to Scripts directory and add the following to Scripts.ini 
'          Don't forget to remove comments (') and set the order appropriately
'
' [CustomReport]
' FileName=CustomReport.vbs
' ProcName=CustomReport
' Order=50
' DisplayName=Custom Report
' Description=Custom Report
' Language=VBScript
' ScriptType=1
'
' FORMAT:
'   Add: A1 - "1" becomes "2"
'   Newline char: C*** - Newline character
'   Divide: D100 - "1" becomes "0.01"
'   Extract: E()2 - "A B C" becomes "B"
'   Format date: Fd/m/Y - "30th Oct 2009" becomes "30/10/2009" - http://uk.php.net/manual/en/function.date.php
'   Hyperlink: H... - Create link in HTML
'   Hyperlink: I... - Create link in HTML using mask 
'   Justify: JL for left, JR for right, JC for centre
'   Lowercase: L - "Word" becomes "word"
'   Multiply: M100 - "1" becomes "100"
'   Number: N2 - "1" becomes "1.00"
'   Prefix: P( - "Word" becomes "(Word"
'   Replace: R1=One - "1" becomes "One"
'   Suffix: S) - "Word" becomes "Word)"
'   Title case: T - "WORD" becomes "Word"
'   Uppercase: U - "Word" becomes "WORD"
'   Width: W25% - Column width in HTML/Excel
'   Leading zeros: Z2 - "1" becomes "01"
'   Traverse: \1 - "C:\Music\Test.mp3" becomes "Music\Test.mp3"
'
' FIXES: Fixed SongLengthString back to unformatted value
'        Added SongLengthTime and SongLengthLocal with formatted values
'
(Exceeds 60,000 characters)
Last edited by trixmoto on Tue May 27, 2008 5:29 am, edited 8 times in total.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Eyal
Posts: 3116
Joined: Sun Jun 26, 2005 9:27 am
Location: Québec

Post by Eyal »

Hi Trixmoto, it's worth a try, it looks very interresting.

Question:
If Number: N2 - "1" becomes "1.00"

Is there a way to Number: X2 - "1" becomes "01" ?
Useful to have track numbers aligned in HTML or text format.


Thanks
Last edited by Eyal on Sat Jun 16, 2007 9:36 pm, edited 1 time in total.
Skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
Eyal
Posts: 3116
Joined: Sun Jun 26, 2005 9:27 am
Location: Québec

Post by Eyal »

I did some report tests in HTML format.
Here's what I did:
Image

Here's what I got:
Image

Apart the apostrophe, what can be done about song lenghts? The first song is 213 seconds long, or 3:33.
Also, it will be great to have the choice of generate a TXT format of the report.

Thanks
Skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Post by Bex »

Impressive!
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Maaspuck
Posts: 156
Joined: Thu Dec 28, 2006 4:41 am
Location: Hamburg, Germany

Cool script

Post by Maaspuck »

indeed, fantastic script!

@Eyal
i tested the html report and it worked fine with the apostrophe and also with all german special characters. Did I understand it right and you want the length 3:33 to be displayed instead of 213472? If yes, you may choose the tag "SongLengthString" instead of "SongLength".

BTW: I also like music by Sylvester and Patrick Cowley.

Maaspuck
Eyal
Posts: 3116
Joined: Sun Jun 26, 2005 9:27 am
Location: Québec

Post by Eyal »

Thanks Maaspuck, that was it. I don't know why I have just overlooked it.

I don't know if I'm the only one, but I also get a IE warning each time:
"To help protect your security, your web browser has restricted this file from showing active content that could access your computer. Click here for options..."
It works with all other french characters, I tried different IE encoding options, but I can't get that apostrophe to display... :(
Skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

@Eyal - I'll add a new format in the next version (probably Z) for adding leading zeros, and TXT file type. The apostrophe is deliberately encoded this way, which your browser should understand (which browser are you using?) but you can remove line 656 which does this if you like.

@Bex - Thanks :)

@Masspuck - Yes, this field is already formatted correctly, removing the need to try and format the raw value.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

New version (1.1) is now available from my website. Changes include...

- Added new field format Z to control leading zeros
- Added new field format A to allow addition
- Added new file type of TXT (textfile)
- Fixed headings not applied to file type XML

Let me know what you think! :)
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
paulmt
Posts: 1170
Joined: Tue Jul 18, 2006 6:06 pm

Post by paulmt »

This script looks very good and exactly what I was looking for.

However I get an error on running after new install.

Line 457 Col. 6 - which is...
Call wsh.Run(str&Chr(34)&Edit1.Text&Chr(34),1,0)

Custom Script 1.1
MM 2.5.5.x
Win XP Svc Pack II
Saving report as HTML

Any ideas please.

Thanks
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

What error message do you get?
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
paulmt
Posts: 1170
Joined: Tue Jul 18, 2006 6:06 pm

Post by paulmt »

trixmoto wrote:What error message do you get?

The report runs, then displays the "report complete do you want to display now"
Clicking on this brings up...

Error #2147023741 - File c:\program files\mediamonkey\scripts\customreport.vbs Line 457 Column 6

AFter clicking "ok"

"Error happened during script execution: No application is associated with the specified file for this operation"

Click on "ok" and the error message goes away

**** But I have figured this out..... my error!
I was assigning a file name but not a directory, I thought it would just save to the scripts folder by default. Once I clicked on the /\ and selected a directory the script works perfectly.

Thanks
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Ok, I'm glad you sorted this out. I'll try to put a catch for this error in the next version.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Mizery_Made
Posts: 2283
Joined: Tue Aug 29, 2006 1:09 pm
Location: Kansas City, Missouri, United States

Post by Mizery_Made »

Code: Select all

Error #5 - Microsoft VBScript runtime error
Invalid procedure call or argument
File: "C:\Program Files\MediaMonkey\Scripts\CustomReport.vbs", Line: 403, Column: 8
Don't know what that's about.
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Well line 403 is...

Code: Select all

Call f.WriteLine(Join(dic.Items,","))
You could try replacing this with the following...

Code: Select all

On Error Resume Next
Call f.WriteLine(Join(dic.Items,","))
If Err.Number <> 0 Then
  MsgBox Join(dic.Items,",")
  Err.Clear
End If
On Error Goto 0
...which should pop up the text that is invalid instead of the error message. What is the text which causes the error?
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Mizery_Made
Posts: 2283
Joined: Tue Aug 29, 2006 1:09 pm
Location: Kansas City, Missouri, United States

Post by Mizery_Made »

Appears to be having trouble with the characters "е" & "ш" *Shrugs*

As for what you said to replace, I did so and the error still comes up, now only thing different is it says line 422 instead of 403.
Post Reply