Peke wrote: ↑Wed Aug 04, 2021 5:28 pm
...
May I ask why are you making MM4 script when MM5 is already out and your work can be far more useful if added to MM5 (please do not get me wrong, but user base of MM5 will only grow)?
May I wonder
I thought I'd address that last question first before addressing your suggestions (which I thank you for).
Basically, I don't know MediaMonkey and I don't know VBS, JavaScript, much HTML, or any flavor of object-oriented programming. However, I find myself partly responsible getting an old MediaMonkey installation ready for use by a group of highly non-technical elderly folks that haven't seen MediaMonkey (or each other) for 18 months. This has to be ready in 2 more days, and has to look and feel as much as possible like it did 18 months ago.
18 months ago it was MM 2.5 running on 3 ancient laptops, maintained by a person using homegrown Access tools to keep the 3 implementations in sync. But he is getting out of that role. I discovered I could MM 4.1 to look and act almost identical to the old MM 2.5 implementation. And the cloning of the implementations is trivial with simple Windows copy utilities (either File Explorer or Robocopy) followed by execution of the MM script UpdateLocationOfFiles.
I have no idea whether the same can be said for MM 5. All the hype has been on how much it has changed, not on how similar it is to past versions. And I have no idea if UpdateLocationOfFiles has been rewritten in JavaScript (or has been replaced with a different script).
So back to the topic at hand. I need to execute UpdateLocationOfFiles on multiple laptops at least once a week, but I really don't want it accidentally executed by our typical MM user. We
do have those users execute some scripts so I really want UpdateLocationOfFiles (a type=0 script) to not show in the list of scripts.
I'll cope with looking into MM 5 when I don't have a looming deadline.
Your idea of inserting UpdateLocationOfFiles into my invoking script may be the way I have to go, but it is a massive script - 35KB in compressed format - all unnecessary blanks removed. I'm uncomfortable with doing anything other than just executing it.
I think I'm proving myself wrong, but I thought this should be a fairly simple process - having a menu item execute a script that did not create the menu item. It maybe is not so straightforward.
Some time after posting my latest question I found SDB.ScriptsPath. It has an "s" that yours does not. Are they two different functions? Anyway, I a simple test. I created a trivial script
Code: Select all
Sub ShowTestMsg()
Dim res
res = SDB.MessageBox( SDB.Localize("This is a test"), mtError, Array(mbOk))
End Sub
and named it ShowTestMsg.vbs. It works fine as a Type=0 script.
I then created an Auto script to create a menu item:
Code: Select all
Sub OnStartup
Dim FullPath
FullPath=SDB.ScriptsPath & "ShowTestMsg.vbs"
With SDB.UI.AddMenuItem(SDB.UI.Menu_File, 1, 3)
.Caption="Show a test message"
.UseScript=FullPath
.OnClickFunc="ShowTestMsg"
End With
End Sub
The menu item is created, but when I click on it I get an error popup stating:
Error happened during script execution: OLE error 800A01C2
Any idea what that is about? A web search turned up both a number of arguments error and an attempt to set an object with a string.