[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")
shell.Run(command)[/code]
Launch_MTS.zip (468 Bytes)