[quote="jmb"]My problem is that that software use a different command line paramater (-sxd) when target is a directory
I can make 2 hotkeys but it's a bad way
How make a conditionnal launch in D.O. script ?[/quote]
I've just sent GPSoft a feature request suggesting a way to make it easier to do this. For now, though, you can use a bit of VBScript glue to make it happen.
You should just need to change your hotkey so that it calls Launch_MTS.vbs instead of mp3tag_s.exe (and also just pass it {filepath} on its own, without the -sxf or -sxd stuff, of course).
Here's what's in Launch_MTS.vbs, but it's also attached below for your convenience.
[code]option explicit
Dim args
set args = WScript.Arguments
if args.Count <> 1 then
MsgBox "Launch_MTS.vbs: No argument given."
WScript.Quit 1
end if
Dim filepath
filepath = args.Item(0)
Dim fs
Set fs = CreateObject("Scripting.FileSystemObject")
Dim command
If fs.FileExists(filepath) Then
command = """%ProgramFiles%\Mp3-Tag Studio\mp3tag_s.exe"" ""-sxf" & filepath & """"
ElseIf fs.FolderExists(filepath) Then
command = """%ProgramFiles%\Mp3-Tag Studio\mp3tag_s.exe"" ""-sxd" & filepath & """"
Else
MsgBox "Launch_MTS.vbs: File or folder does not exist: """ & filepath & """"
WScript.Quit 1
End If
Dim shell
Set shell = CreateObject("WScript.Shell")
[quote="jmb"]Another Question = How i can read mp3 artist field of selected mp3 file in a D.O. variable ?
i want create a folder with this value and not with the name of the file[/quote]
Please, in future, ask separate questions in new threads. It makes the forum easier to search when other people are looking for answers to the same question.
If you need the artist name in order to organise the music files then the answer is in this FAQ:
You could try with the context menu option.
If the the program adds context menu for files and folders it's easy
If not you have to add it manually in "File Types".
[quote="nudel"][quote="jmb"]My problem is that that software use a different command line paramater (-sxd) when target is a directory
I can make 2 hotkeys but it's a bad way
How make a conditionnal launch in D.O. script ?[/quote]
I've just sent GPSoft a feature request suggesting a way to make it easier to do this. For now, though, you can use a bit of VBScript glue to make it happen.
You should just need to change your hotkey so that it calls Launch_MTS.vbs instead of mp3tag_s.exe (and also just pass it {filepath} on its own, without the -sxf or -sxd stuff, of course).
Here's what's in Launch_MTS.vbs, but it's also attached below for your convenience.
[code]option explicit
Dim args
set args = WScript.Arguments
if args.Count <> 1 then
MsgBox "Launch_MTS.vbs: No argument given."
WScript.Quit 1
end if
Dim filepath
filepath = args.Item(0)
Dim fs
Set fs = CreateObject("Scripting.FileSystemObject")
Dim command
If fs.FileExists(filepath) Then
command = """%ProgramFiles%\Mp3-Tag Studio\mp3tag_s.exe"" ""-sxf" & filepath & """"
ElseIf fs.FolderExists(filepath) Then
command = """%ProgramFiles%\Mp3-Tag Studio\mp3tag_s.exe"" ""-sxd" & filepath & """"
Else
MsgBox "Launch_MTS.vbs: File or folder does not exist: """ & filepath & """"
WScript.Quit 1
End If
Dim shell
Set shell = CreateObject("WScript.Shell")