No "OnStartup" event in MM4 [#8482]
Moderators: Gurus, Addon Administrators
-
- Posts: 931
- Joined: Fri Jul 10, 2009 8:10 am
No "OnStartup" event in MM4 [#8482]
This has been removed in MM4. Why?
http://www.mediamonkey.com/wiki/index.p ... ts_members
I would like Clear Now Playing to work but it seems to need this even to operate. (http://www.mediamonkey.com/forum/viewto ... 35#p313935)
http://www.mediamonkey.com/wiki/index.p ... ts_members
I would like Clear Now Playing to work but it seems to need this even to operate. (http://www.mediamonkey.com/forum/viewto ... 35#p313935)
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507
Re: 1441 No "OnStartup" event in MM4
It was actually an error in documentation, this event hasn't ever existed.
If you need to do anything on startup, you probably could do so when the script is first called?
Jiri
If you need to do anything on startup, you probably could do so when the script is first called?
Jiri
Re: 1441 No "OnStartup" event in MM4
I don't understand what you are talking about. How is that that this event hasn't ever existed? All my auto-scripts has OnStartup event handler which is executed on every start-up of the program - MM2, MM3 as well as MM4 (tried with many versions, even the latest build 1442). Actually, none of my auto-scripts could be used without that event since I am setting the menu items for the script's options and other initialization code during the start-up.
● Magic Nodes 4.3.3 / 5.2 ● RegExp Find & Replace 4.4.9 / 5.2 ● Invert Selection/Select None 1.5.1 ● Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1 ● Expand Child Nodes/Expand All 1.1.2 ● Event Logger 2.7 ● Filtered Statistics Report 1.6 ● Track Redirection & Synchronization 3.4.2 ● Restore/Synchronize Database 3.1.8 / 4.0.1 ● Find Currently Playing Track 1.3.2 ● Queue List 1.2.1 ● Add to Library on Play 1.0.1 ● Tree Report for Child Nodes 1.1.1 ● Update Location of Files in Database 1.4.5 / 2.3 ● Inherit Child Playlists 1.0.3 ● Add Currently Playing/Selected Track(s) to Playlist 1.2
Re: 1441 No "OnStartup" event in MM4
Zvezdan, this works correctly for me with the latest build:
The "BLA BLA" is correctly added to Edit menu.
So what is wrong here?
Code: Select all
Option Explicit
Dim UI : Set UI = SDB.UI
Sub OnStartUp()
Dim mnuTest
Set mnuTest = SDB.UI.AddMenuItem(SDB.UI.Menu_Edit, 0, 0)
mnuTest.Caption = SDB.Tools.RemapASCII("BLA BLA")
mnuTest.OnClickFunc = "Test1"
mnuTest.UseScript = Script.ScriptPath
End Sub
So what is wrong here?
-
- Posts: 931
- Joined: Fri Jul 10, 2009 8:10 am
Re: 1441 No "OnStartup" event in MM4
OK, so everyone except Jiri seems to think that the Sub OnStartup() gets called in both MM3 and MM4
... and I've been back to my original test to find that it works fine. Doh!
So, are we just looking at a documentation problem?
... and I've been back to my original test to find that it works fine. Doh!
So, are we just looking at a documentation problem?
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507
Re: 1441 No "OnStartup" event in MM4
Please read my previous post again. That are my words exactly - there is nothing wrong there, OnStartup works fine in MM4 as it was before. However, wrong is jiri who removed a description of that event from wiki claiming that it has never existed.Ludek wrote:So what is wrong here?
● Magic Nodes 4.3.3 / 5.2 ● RegExp Find & Replace 4.4.9 / 5.2 ● Invert Selection/Select None 1.5.1 ● Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1 ● Expand Child Nodes/Expand All 1.1.2 ● Event Logger 2.7 ● Filtered Statistics Report 1.6 ● Track Redirection & Synchronization 3.4.2 ● Restore/Synchronize Database 3.1.8 / 4.0.1 ● Find Currently Playing Track 1.3.2 ● Queue List 1.2.1 ● Add to Library on Play 1.0.1 ● Tree Report for Child Nodes 1.1.1 ● Update Location of Files in Database 1.4.5 / 2.3 ● Inherit Child Playlists 1.0.3 ● Add Currently Playing/Selected Track(s) to Playlist 1.2
Re: 1441 No "OnStartup" event in MM4
It was error in documentation That needs to be fixed as like you pointed Zvezdan it works as it was always worked eg. executed on Auto-Script startup. it is not regular Event you can hook on like with OnPlay.
I explained this in http://www.ventismedia.com/mantis/view.php?id=8482
NOTE: OnShutdown event also do not belong there. Documentation should be updated/fixed.
I explained this in http://www.ventismedia.com/mantis/view.php?id=8482
NOTE: OnShutdown event also do not belong there. Documentation should be updated/fixed.
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
How to attach PICTURE/SCREENSHOTS to forum posts
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
How to attach PICTURE/SCREENSHOTS to forum posts
Re: 1441 No "OnStartup" event in MM4
Well, strictly speaking, you are right that OnStartup is not regular event since it cannot be registered with the Application object, but it should be mentioned there anyway. How do you expect that scripters learn for that event handler if you don't mention it in wiki?Peke wrote: it is not regular Event you can hook on like with OnPlay.
I explained this in http://www.ventismedia.com/mantis/view.php?id=8482
NOTE: OnShutdown event also do not belong there. Documentation should be updated/fixed.
OnShutdown event should belong there for sure since it could be registered as e.g. OnPlay, for example:
Script.RegisterEvent SDB, "OnShutdown", "ClearIniSection"
● Magic Nodes 4.3.3 / 5.2 ● RegExp Find & Replace 4.4.9 / 5.2 ● Invert Selection/Select None 1.5.1 ● Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1 ● Expand Child Nodes/Expand All 1.1.2 ● Event Logger 2.7 ● Filtered Statistics Report 1.6 ● Track Redirection & Synchronization 3.4.2 ● Restore/Synchronize Database 3.1.8 / 4.0.1 ● Find Currently Playing Track 1.3.2 ● Queue List 1.2.1 ● Add to Library on Play 1.0.1 ● Tree Report for Child Nodes 1.1.1 ● Update Location of Files in Database 1.4.5 / 2.3 ● Inherit Child Playlists 1.0.3 ● Add Currently Playing/Selected Track(s) to Playlist 1.2
Re: No "OnStartup" event in MM4 [#8482]
So, just to summarize:
- There really haven't ever existed OnStartup COM event.
- OnStartup procedure of a script (if exists) is automatically called on startup. Since it the old way of calling script procedures, it would make sense to deprecate it in the next version of MM and rather implement the COM event.
Jiri
- There really haven't ever existed OnStartup COM event.
- OnStartup procedure of a script (if exists) is automatically called on startup. Since it the old way of calling script procedures, it would make sense to deprecate it in the next version of MM and rather implement the COM event.
Jiri
Re: No "OnStartup" event in MM4 [#8482]
Will you keep compatibility with the existing scripts after that implementation?jiri wrote:OnStartup procedure of a script (if exists) is automatically called on startup. Since it the old way of calling script procedures, it would make sense to deprecate it in the next version of MM and rather implement the COM event.
● Magic Nodes 4.3.3 / 5.2 ● RegExp Find & Replace 4.4.9 / 5.2 ● Invert Selection/Select None 1.5.1 ● Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1 ● Expand Child Nodes/Expand All 1.1.2 ● Event Logger 2.7 ● Filtered Statistics Report 1.6 ● Track Redirection & Synchronization 3.4.2 ● Restore/Synchronize Database 3.1.8 / 4.0.1 ● Find Currently Playing Track 1.3.2 ● Queue List 1.2.1 ● Add to Library on Play 1.0.1 ● Tree Report for Child Nodes 1.1.1 ● Update Location of Files in Database 1.4.5 / 2.3 ● Inherit Child Playlists 1.0.3 ● Add Currently Playing/Selected Track(s) to Playlist 1.2
Re: No "OnStartup" event in MM4 [#8482]
Definitely, at least for a limited time (of few year?) to allow update of scripts.
Jiri
Jiri