Hi guys! I'm really struggling with this. Maybe someone could help me
I want to open files using this sript in the same instance of Spek (same window) (http://spek.cc/)
At this moment it will open in another window every time. The only way is to drag and drop in the same window.
' A simple script that shows how to open a selected track in another application.
' In this case it is Spek (expected to be in C:\Program Files (x86)\Spek\spek.exe).
Const SpekPath = "C:\Program Files (x86)\Spek\spek.exe"
Sub OpenInSpek
' Define variables
Dim WShell, Command, NPSong
' Get list of selected tracks from MediaMonkey
Set NPSong = SDB.Player.CurrentSong
' Prepare WScript.Shell object, which can be used for execution of applications
Set WShell = CreateObject("WScript.Shell")
If Not NPSong is Nothing Then
Command = Chr(34) & SpekPath & Chr(34) & " " & Chr(34) & NPSong.Path & Chr(34)
End If
' And execute the command
WShell.Run Command, 1, 0
End Sub
Function IsProcessRunning( strComputer, strProcess )
Dim Process, strObject
IsProcessRunning = False
strObject = "winmgmts://" & strComputer
For Each Process in GetObject( strObject ).InstancesOf( "win32_process" )
If UCase( Process.name ) = UCase( strProcess ) Then
IsProcessRunning = True
Exit Function
End If
Next
End Function
You are right! That's also what I was thinking about.
I'm curious if I can make this script to work like this: if i select a track, that track to automatically open in Spek (even if I select it by a simple click or directional (up&down) arrows).
At this moment it will open the selected track only when i press a keyboard shortcut (Ctrl+S for eg.)
You can help me with this or I have to create another post with this issue ?
i found something on internet about how to run only one instance of an application here: https://stackoverflow.com/questions/419 ... pplication , but i have difficulties to implement this for SPEK release here : https://github.com/withmorten/spek/releases
You seem to be more experienced with programming than I do. (I have not coded for about 4 years now: D). Maybe you want to try or help me with this code. Thank you
dim S, X
Sub LaunchNotepad()
Set S = CreateObject("WScript.Shell")
Set X = S.Exec("Notepad.exe")
End Sub
Sub QuitNotepad()
If X.Status = 0 Then X.Terminate()
Set X = Nothing
Set S = Nothing
End Sub
Call LaunchNotepad
WScript.Sleep 10000
Call QuitNotepad
Thanks a lot Peke!
I really appreciate the help given but the information presented is too much for me at this moment. Maybe i will return someday when i'll have more time to digest all this information.
Hi,
OK, it seams to me fairly simple to change and add as 90% of code you already have here and should work after Copy/Paste and little modification., I also agree when all thrown at once it looks like complicated
Thank you Peke!!
i got an error at running the script: Error #424 - Microsoft VBScript runtime error. Object required: '[string: "SPEK"]'. File: "C:\Users\...\Local\Temp'MediaMonkey\install.vbs", Line:5, Column:4." & "Error: SPEK not installed".
Note: I installed SPEK in c:\SPEK change path in runspek.vbs
I addressed it slightly different as i'm using it as a portable install.
I Extracted the Spek folder into my plugins folder then addressed in runspek.vbs as "Plugins\Spek\Spek.exe"
Windows 10 Pro x64 2TB USB3 External Hdd with Quad Core 3600Mhz CPU and 10GB Ram
MM 4.1.21.1871 Portable on External Hdd
TESTING MM 5.0.0.2113
Numerous Addons
User Since 2006 (Lifetime License) since 2012
The script run perfectly now, you made a really good job . Thank you again!
Now I'm wondering if it can be made to keep the original position and size of the window.