The chunk of code in the original script that gets the directory is
Code: Select all
'get filename
Dim dir : dir = ini.StringValue("Scripts","LastImportM3UDir")
Dim res : res = SDB.SelectFolder(dir,"Select folder of playlists:")
If res = "" Then
ImportDir = False
Dim dlg : Set dlg = SDB.CommonDialog
dlg.DefaultExt = ".m3u"
dlg.Filter = "Playlists (*.m3u)|*.m3u|Unicode playlists (*.m3u8)|*.m3u8|All files (*.*)|*.*"
dlg.Flags = cdlOFNOverwritePrompt+cdlOFNHideReadOnly+cdlOFNNoChangeDir
If dir = "" Then
dlg.InitDir = SDB.MyMusicPath
Else
dlg.InitDir = dir
End If
dlg.ShowOpen
If Not dlg.Ok Then
Exit Sub
End If
res = dlg.FileName
ini.StringValue("Scripts","LastImportM3UDir") = Left(res,InStrRev(res,"\"))
Else
ImportDir = True
If Right(res,1) <> "\" Then
res = res&"\"
End If
ini.StringValue("Scripts","LastImportM3UDir") = res
End If