by DiddeLeeDoo » Tue Sep 05, 2006 9:45 pm
Here's a little script example. Adds a copy icon to the standard toolbar and when you hit it the selected files get copied to the folder you choose in the dialog.
Not much error controls and stuff in this one, but may get you going.
Code: Select all
'----------------------------------------------------------------------
'\Program Files\MediaMonkey\Scripts\Auto\CopyFiles.vbs
' Version: 0.95
' Date: 5 September 2006
' By DiddeLeeDoo
'----------------------------------------------------------------------
Sub OnStartup
Set CFT=SDB.UI.AddMenuItem(SDB.UI.Menu_TbStandard, 0, 0)
CFT.Caption="Copy Files To"
CFT.IconIndex=9
CFT.UseScript=Script.ScriptPath
CFT.OnClickFunc="CopyFiles"
End Sub
Sub CopyFiles(o)
Set FSO=CreateObject("Scripting.FileSystemObject")
Set SHL=CreateObject("Shell.Application")
Set dbT=SDB.CurrentSongList
Set FLD=SHL.BrowseForFolder(0,"Destination:",0,"")
If Not FLD Is Nothing Then
For i = 0 To dbT.Count-1
Set Sng=dbT.Item(i)
CFr=Sng.Path
CTo=FLD.Self.Path & "\" & Right(CFr,Len(CFr)-InStrRev(CFr,"\"))
FSO.CopyFile CFr, CTo
Next
End If
End Sub
Added, I pasted in a 'test code'..... put the right one in just now..
Here's a little script example. Adds a copy icon to the standard toolbar and when you hit it the selected files get copied to the folder you choose in the dialog.
Not much error controls and stuff in this one, but may get you going.
[code]'----------------------------------------------------------------------
'\Program Files\MediaMonkey\Scripts\Auto\CopyFiles.vbs
' Version: 0.95
' Date: 5 September 2006
' By DiddeLeeDoo
'----------------------------------------------------------------------
Sub OnStartup
Set CFT=SDB.UI.AddMenuItem(SDB.UI.Menu_TbStandard, 0, 0)
CFT.Caption="Copy Files To"
CFT.IconIndex=9
CFT.UseScript=Script.ScriptPath
CFT.OnClickFunc="CopyFiles"
End Sub
Sub CopyFiles(o)
Set FSO=CreateObject("Scripting.FileSystemObject")
Set SHL=CreateObject("Shell.Application")
Set dbT=SDB.CurrentSongList
Set FLD=SHL.BrowseForFolder(0,"Destination:",0,"")
If Not FLD Is Nothing Then
For i = 0 To dbT.Count-1
Set Sng=dbT.Item(i)
CFr=Sng.Path
CTo=FLD.Self.Path & "\" & Right(CFr,Len(CFr)-InStrRev(CFr,"\"))
FSO.CopyFile CFr, CTo
Next
End If
End Sub[/code]
Added, I pasted in a 'test code'..... put the right one in just now..