trying to add scripts to MM error 13

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

duckcubbie
Posts: 6
Joined: Fri Jan 18, 2008 12:46 pm
Contact:

trying to add scripts to MM error 13

Post by duckcubbie » Thu Feb 14, 2008 2:09 pm

I am trying to add Tempo.vbs to my scripts.ini file.

[Tempo]
FileName=Tempo.vbs
ProcName=Tempo
Order=50
DisplayName=Tempo...
Description=adds tempo to songs
Language=VBScript
ScriptType=0


This shows up in the Scripts in MM so I chose "Tempo" and it gives me an error:
error #13 Microsoft VBScript Runtime error, Type Mismatch 'Tempo'

I added it in the .ini file the way the other scripts are and they run fine.
HELP please.

Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm
Location: Belgium
Contact:

Post by Steegy » Thu Feb 14, 2008 4:47 pm

Is there a procedure "Tempo" in your script? It should be as you specified this using ProcName (as starting point of your script).
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).

duckcubbie
Posts: 6
Joined: Fri Jan 18, 2008 12:46 pm
Contact:

where would i put ProcName

Post by duckcubbie » Thu Feb 14, 2008 9:06 pm

where would i put the ProcName in the script:

Sub OnStartup
Dim Song
' Set Tempo for non-podcasts, where BPM is known and the Tempo has not already been set.
SDB.Database.BeginTransaction
Dim SongIter : Set SongIter = SDB.Database.QuerySongs("")
Do While Not SongIter.EOF
Set Song = SongIter.Item
if UCase(Song.Genre) <> UCase("Podcast") And UCase(Song.Tempo) = UCase("None") or Song.Tempo = "" And Song.BPM >= 0 Then
if Song.BPM <= 56 then
Song.Tempo = "Very Slow"
elseif Song.BPM <= 82 then
Song.Tempo = "Slow"
elseif Song.BPM <= 145 then
Song.Tempo = "Moderate"
elseif Song.BPM <= 200 then
Song.Tempo = "Fast"
Else
Song.Tempo = "Very Fast"
end if
Song.UpdateDB
Song.WriteTags
end if
SongIter.Next
Loop
Set SongIter = Nothing
SDB.Database.Commit
end sub

Teknojnky
Posts: 5533
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Re: where would i put ProcName

Post by Teknojnky » Thu Feb 14, 2008 10:30 pm

duckcubbie wrote:where would i put the ProcName in the script:

Code: Select all

Sub Tempo 
   Dim Song 
   ' Set Tempo for non-podcasts, where BPM is known and the Tempo has not already been set. 
   SDB.Database.BeginTransaction 
   Dim SongIter : Set SongIter = SDB.Database.QuerySongs("") 
   Do While Not SongIter.EOF 
      Set Song = SongIter.Item 
      if UCase(Song.Genre) <> UCase("Podcast") And UCase(Song.Tempo) = UCase("None") or Song.Tempo = "" And Song.BPM >= 0 Then 
         if Song.BPM <= 56 then 
            Song.Tempo = "Very Slow" 
         elseif Song.BPM <= 82 then 
            Song.Tempo = "Slow" 
         elseif Song.BPM <= 145 then 
            Song.Tempo = "Moderate" 
         elseif Song.BPM <= 200 then 
            Song.Tempo = "Fast" 
         Else 
            Song.Tempo = "Very Fast" 
         end if 
         Song.UpdateDB 
         Song.WriteTags 
      end if 
      SongIter.Next 
   Loop 
   Set SongIter = Nothing 
   SDB.Database.Commit 
end sub
instead of using onstartup you want to use whatever proc name that you want to put in the scripts ini file.

duckcubbie
Posts: 6
Joined: Fri Jan 18, 2008 12:46 pm
Contact:

YEAH !!!!!!!

Post by duckcubbie » Thu Feb 14, 2008 10:38 pm

Got it thank you mates for replying. I will get the hang of this scripts thing yet !

:D

Sub SetTempo
Dim Song
' Set Tempo for non-podcasts, where BPM is known and the Tempo has not already been set.
SDB.Database.BeginTransaction
Dim SongIter : Set SongIter = SDB.Database.QuerySongs("")
Do While Not SongIter.EOF
Set Song = SongIter.Item
if UCase(Song.Genre) <> UCase("Podcast") And UCase(Song.Tempo) = UCase("None") or Song.Tempo = "" And Song.BPM >= 0 Then
if Song.BPM <= 56 then
Song.Tempo = "Very Slow"
elseif Song.BPM <= 82 then
Song.Tempo = "Slow"
elseif Song.BPM <= 145 then
Song.Tempo = "Moderate"
elseif Song.BPM <= 200 then
Song.Tempo = "Fast"
Else
Song.Tempo = "Very Fast"
end if
Song.UpdateDB
Song.WriteTags
end if
SongIter.Next
Loop
Set SongIter = Nothing
SDB.Database.Commit
end sub

Post Reply