Custom Report 2.4 - Updated 18/07/2010

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

Custom Report 2.4 - Updated 18/07/2010

Postby trixmoto on Sun Jun 17, 2007 12:20 am

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 2.4
'
' AUTHOR: trixmoto (http://trixmoto.net)
' DATE : 18/07/2010
'
' 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
'   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
'   Leading zeros: Z2 - "1" becomes "01"
'   Traverse: \1 - "C:\Music\Test.mp3" becomes "Music\Test.mp3"
'
' FIXES: Added columns Day, Month and OriginalDate
'
(Exceeds 60,000 characters)
Last edited by trixmoto on Tue May 27, 2008 10:29 am, edited 8 times in total.
Loving the Monkey? - Get Gold
Check out my scripts at http://trixmoto.net including my top ten
Getting "Product Installation Error" when installing scripts? - Try this
Subscribe to my RSS feed for all the latest news
trixmoto
 
Posts: 8509
Joined: Fri Aug 26, 2005 8:28 am
Location: England

Postby Eyal on Sun Jun 17, 2007 12:36 am

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 Sun Jun 17, 2007 2:36 am, edited 1 time in total.
My skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
Eyal
 
Posts: 2462
Joined: Sun Jun 26, 2005 2:27 pm
Location: Canada

Postby Eyal on Sun Jun 17, 2007 2:26 am

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
My skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
Eyal
 
Posts: 2462
Joined: Sun Jun 26, 2005 2:27 pm
Location: Canada

Postby Bex on Sun Jun 17, 2007 7:32 am

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
Bex
 
Posts: 5924
Joined: Fri May 21, 2004 10:44 am
Location: Sweden

Cool script

Postby Maaspuck on Sun Jun 17, 2007 8:17 am

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
Maaspuck
 
Posts: 151
Joined: Thu Dec 28, 2006 9:41 am
Location: Hamburg, Germany

Postby Eyal on Sun Jun 17, 2007 1:02 pm

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... :(
My skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
Eyal
 
Posts: 2462
Joined: Sun Jun 26, 2005 2:27 pm
Location: Canada

Postby trixmoto on Sun Jun 17, 2007 8:36 pm

@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.
Loving the Monkey? - Get Gold
Check out my scripts at http://trixmoto.net including my top ten
Getting "Product Installation Error" when installing scripts? - Try this
Subscribe to my RSS feed for all the latest news
trixmoto
 
Posts: 8509
Joined: Fri Aug 26, 2005 8:28 am
Location: England

Postby trixmoto on Mon Jun 18, 2007 10:32 am

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! :)
Loving the Monkey? - Get Gold
Check out my scripts at http://trixmoto.net including my top ten
Getting "Product Installation Error" when installing scripts? - Try this
Subscribe to my RSS feed for all the latest news
trixmoto
 
Posts: 8509
Joined: Fri Aug 26, 2005 8:28 am
Location: England

Postby paulmt on Wed Jul 18, 2007 7:19 am

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
paulmt
 
Posts: 1148
Joined: Tue Jul 18, 2006 11:06 pm

Postby trixmoto on Wed Jul 18, 2007 8:33 am

What error message do you get?
Loving the Monkey? - Get Gold
Check out my scripts at http://trixmoto.net including my top ten
Getting "Product Installation Error" when installing scripts? - Try this
Subscribe to my RSS feed for all the latest news
trixmoto
 
Posts: 8509
Joined: Fri Aug 26, 2005 8:28 am
Location: England

Postby paulmt on Thu Jul 19, 2007 6:42 am

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
paulmt
 
Posts: 1148
Joined: Tue Jul 18, 2006 11:06 pm

Postby trixmoto on Thu Jul 19, 2007 8:59 am

Ok, I'm glad you sorted this out. I'll try to put a catch for this error in the next version.
Loving the Monkey? - Get Gold
Check out my scripts at http://trixmoto.net including my top ten
Getting "Product Installation Error" when installing scripts? - Try this
Subscribe to my RSS feed for all the latest news
trixmoto
 
Posts: 8509
Joined: Fri Aug 26, 2005 8:28 am
Location: England

Postby Mizery_Made on Thu Jul 26, 2007 12:58 pm

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.
Mizery_Made
 
Posts: 1587
Joined: Tue Aug 29, 2006 6:09 pm
Location: Kansas City, Missouri, United States

Postby trixmoto on Thu Jul 26, 2007 2:47 pm

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?
Loving the Monkey? - Get Gold
Check out my scripts at http://trixmoto.net including my top ten
Getting "Product Installation Error" when installing scripts? - Try this
Subscribe to my RSS feed for all the latest news
trixmoto
 
Posts: 8509
Joined: Fri Aug 26, 2005 8:28 am
Location: England

Postby Mizery_Made on Thu Jul 26, 2007 5:58 pm

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.
Mizery_Made
 
Posts: 1587
Joined: Tue Aug 29, 2006 6:09 pm
Location: Kansas City, Missouri, United States

Next

Return to Need Help with Addons?

Who is online

Users browsing this forum: Ask Jeeves [Bot] and 5 guests