Page 1 of 2

Invert Selection/Select None 1.5 (2012-02-04) [MM3+]

Posted: Mon May 26, 2008 8:16 pm
by ZvezdanD
I asked for this in the Wishlist forum long time ago, but without any response from MM developers. After implementing similar functionality into the RegExp Find & Replace script, I decided to make this as stand-alone script.

Description:
This add-on is for use with MediaMonkey 3.0 or higher. MediaMonkey has the Select All option, but not Select None, nor Invert Selection. So, this script allows such options when selecting tracks in the main tracklist or the Now Playing panel. For example, you could have selected all tracks from the first disc of some displayed double-CD album, then you could choose Invert Selection to get selected tracks from the second disc.

Download:
http://SOLAIR.EUnet.rs/~zvezdand/InvertSelection.htm

What is new:
v1.5 - 2012-02-04
* Improved: speed in many cases;
* Fixed: Select None option [MM4].

v1.4 - 2009-01-26
- Improved: speed (drastically) for the Now Playing panel with MM 3.1.0.1214 and up.

v1.3 - 2009-01-18
- Improved: speed (drastically) for the main tracklist panel with MM 3.1.0.1214 and up.

v1.2 - 2009-01-10
- Improved: speed with sorted tracklists which contain big number of tracks;
- Fixed: detection when the Now Playing panel has a focus, even with MM3 older that 3.1.0.1210.

v1.1.1 - 2008-06-02
- Regression: speed with sorted tracklists which contain big number of tracks;
- Fixed: duplicating of the first track if it is selected.

v1.1 - 2008-05-30
- Added: support for Now Playing panel, My Computer node and for unsorted tracklist.

v1.0 - 2008-05-27
- First public version.

Installation:
Just double-click on the MMIP file.

Usage:
Press Ctrl+I to Invert selection and Ctrl+D to Select none or choose corresponding options from the Edit menu.

Note:
If you are using MediaMonkey older than 3.1.0.1214, the Invert Selection in the Now Playing panel, My Computer node and unsorted tracklist is drastically slower than with the sorted tracklist, so use it only when they don't have too much tracks.

Posted: Mon May 26, 2008 8:39 pm
by gege
Hey! I loved this one! Congrats.

Just one thing: it looks like "Invert Selection" doesn't work well in Now Playing window... If select a bunch of files in NP, and then CTRL+I, all files get selected.

Posted: Mon May 26, 2008 8:59 pm
by Bex
Nice one ZvezdanD! Really useful.
I'm getting the same error as gege in both NP and NP_main_window.

Posted: Tue May 27, 2008 7:28 am
by ZvezdanD
Bex wrote:I'm getting the same error as gege in both NP and NP_main_window.
Sorry folks. I am not using the MM player at all, so I didn't tried it with the Now Playing panel. Unfortunately, as far as I know, there is no a way to find which panel is in focus. There is also more serious problem - I have used RemoveSelectedTracks and AddTracksFromQuery which work only with tracklist panel, but not with Now Playing. :( Anyway, the Now Playing panel already has the Invert selection option into its Edit menu (however, without keyboard shortcut).

BTW, what is a difference between NP ad NP_main_window?

Posted: Tue May 27, 2008 7:33 am
by Bex
When you click on the Now Playing Node then the Main Window becames NP_Main_Window. It works differently compared to the normal main window in respect of Right click menus etc...

Btw, Playlists work very strange with this script. Tracks are added to the window but only temporary...

Posted: Tue May 27, 2008 7:42 am
by ZvezdanD
Now I see that there exist options which could be used to add/remove tracks to Now Playing window instead of mentioned ones, but anyway I don't know how to detect which is active panel through scripting. So, use it with all of this limitations if you wish.

Posted: Fri May 30, 2008 12:27 pm
by ZvezdanD
There is an update for this script (1.1). Now it is possible to invert selection in all panes, but please read the Note section.

I need to say, it is extremely ridiculous that we need to write such big scripts for such trivial tasks because of poor API which MM developers gave to us scripters.

Posted: Sun Jun 01, 2008 3:57 am
by cadmanmeg
So I selected 2 tracks and then hovering over one used ctrl-I and then it created a duplicate. Not a duplicate entry physically, but within the dalabase. Is this how this works? Doesn't seem quite right. Ideas please? Thanks much!

Posted: Sun Jun 01, 2008 7:01 am
by ZvezdanD
cadmanmeg wrote:So I selected 2 tracks and then hovering over one used ctrl-I and then it created a duplicate. Not a duplicate entry physically, but within the dalabase. Is this how this works? Doesn't seem quite right.
Invert selection should do exactly as its name says - to select unselected tracks and vice versa. So, if you have tracklist with, let say, 5 visible tracks and 2 of them which are selected, after press on Ctrl+I there should be selected 3 tracks which previously haven't been selected. If you get different behavior than that, it should be consider as a bug in the script.

Which version of the script and the MM program you are using? Which MM panel you are trying (main tracklist, Now Playing, My Computer...)? Is this panel sorted by any column? Could you send a screenshot?

BTW, this script could not create duplicate in the database, but only in tracklist panel. If you switch to another node in the tree pane and return back to the same node where you previously tried to select tracks, you should see the same number of tracks as before selecting. Actually, this script add one track to traclist to detect which panel is in focus, but immediately after that it remove the same track.

Another possibility for such behavior is that the script wrongly detected that main tracklist has focus and implements old agorythm (from 1.0 version) with RemoveSelectedTracks and AddTracksFromQuery which is much faster than the new one which is applied only on Now Playing pane, My Computer node and unsorted tracklists.

I am sorry, but this happens when we need to use dirty tricks for such trivial things as detecting which panel is in focus and to select/deselect specific tracks.

Posted: Mon Jun 02, 2008 3:36 pm
by ZvezdanD
I think that I found mentioned bug which leads to a duplicated track. There is a new release (1.1.1).

Re: Invert Selection/Select None 1.1.1 [MM3]

Posted: Thu Jun 19, 2008 1:56 am
by cadmanmeg
Sorry I haven't had the time to respond, but now, it all seems to work fine with what I tested again. I am using version 3.0.2.1134.

Re: Invert Selection/Select None 1.2 (2009-01-10) [MM3]

Posted: Sat Jan 10, 2009 1:15 pm
by ZvezdanD
There is a new update (1.2) of this script - it is much faster with sorted tracklists which contain big number of tracks.

Re: Invert Selection/Select None 1.2 (2009-01-10) [MM3]

Posted: Sun Jan 11, 2009 10:44 pm
by MM3 monkey
Thank you, ZvezdanD!

Re: Invert Selection/Select None 1.3 (2009-01-18) [MM3]

Posted: Sun Jan 18, 2009 6:07 pm
by ZvezdanD
This script was broken with MM 3.1.0.1209-1213, but with 1214 and new script update (1.3) it works really fast. Thanks so much to MM developers for new API functions added to the MM :)

Re: Invert Selection/Select None 1.5 (2009-02-04) [MM3]

Posted: Sat Feb 04, 2012 6:35 pm
by ZvezdanD
There is the new update, v1.5 - 2012-02-04
* Improved: speed in many cases;
* Fixed: Select None option [MM4].