trying to add scripts to MM error 13

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: trying to add scripts to MM error 13

YEAH !!!!!!!

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

Re: where would i put ProcName

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.

where would i put ProcName

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

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).

trying to add scripts to MM error 13

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.

Top