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.
trying to add scripts to MM error 13
-
- Posts: 6
- Joined: Fri Jan 18, 2008 12:46 pm
- Contact:
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).
-
- Posts: 6
- Joined: Fri Jan 18, 2008 12:46 pm
- Contact:
where would i put ProcName
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
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
Re: where would i put ProcName
instead of using onstartup you want to use whatever proc name that you want to put in the scripts ini file.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
New script: Last.FM Node Now with DJ Mode!
Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page
Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page
-
- Posts: 6
- Joined: Fri Jan 18, 2008 12:46 pm
- Contact:
YEAH !!!!!!!
Got it thank you mates for replying. I will get the hang of this scripts thing yet !
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
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