Right Click for Scripts -with buttons! (2008-09-07) [MM3]

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Re: Right Click for Scripts (2008-04-05) [MM3]

Post by onenonymous » Sun Jul 06, 2008 3:13 pm

hmmm...what you say seems to make sense.... Although, I'm still not clear on why you'd need access to a menu item on RCFS, but didn't want it in the Tools/Scripts menu in the first place. I'm not looking to be argumentative- just seeking to understand.

There are several scripts in the Auto folder that also load as script type 0 in the scripts.ini file and work fine from Tools/Scripts and RCFS, so I know it can be done (e.g. Trix's BatchArtFinder & RandomisePlaylist). Both of these are examples of auto scripts that don't need any parameters passed to run. This is the type of situation I was thinking of when I said that you don't always need to pass a parameter - and why I suggested the alternative solution. I guess the issue is you don't want your menu items to appear in Tools/Scripts but you do want it in RCFS- and you want multiple menus to call the same procedure and figure out what to do from the caption of the menu item. Your solution works - but so does the one I originally suggested.

In any case, because I'm a reasonable guy (not to mention your code does work :wink: ) I'll grab your suggested code and add it to an minor update I've been working on. If I can get my other minor updates done, I'll post today.

Thanks!

onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Re: Right Click for Scripts (2008-04-05) [MM3]

Post by onenonymous » Sun Jul 06, 2008 4:09 pm

Script is updated.

Version 1.42 Update July 6, 2008 - Download the installer

-Added code suggested by MoDementia to allow for use of auto-scripts. Users will need to manually add any auto scripts entries in scripts.ini if the original script author doesn't do it for you. You'll also need to figure out what procedure to call from the original script.
-Added code to see if my (new) RightClickForReports script is running, and if so, group the two sub-menus together in the same right-click section

MoDementia
Posts: 1321
Joined: Thu Jun 15, 2006 3:26 pm
Location: Geelong, Victoria, Australia

Re: Right Click for Scripts (2008-04-05) [MM3]

Post by MoDementia » Sun Jul 06, 2008 4:12 pm

The scripts are not in the tools --> scripts --> "Export Complete Database" menu as they are already located in a more convenient location with their own menu option
tools --> Export Complete Database
or
play --> Gforce album art
or
even on a toolbar "Backup" and "Batch Art Finder"

A little silly to duplicate them in tools --> scripts as well unless there is an option to hide the menu/toolbar (which there is in "Backup" and "Batch Art Finder" but not in mine) So you can hide the menu option but still activate the script from tools --> scripts.

But as RC4S is available it is understandable that users might require them there as well.

The two auto scripts you refer to do infact use your suggested method. Whether that was specifically added for RC4S or to add them to the tools --> scripts menu to allow the hiding of the toolbar icons I don't know, but it did require additional modification of both scripts.
For example in "Batch Art Finder" the toolbar calls Sub DoBatchArtFinder(itm) (itm) = (o) but the ini section calls Sub BatchArtFinder which sends a null itm to DoBatchArtFinder

I hope that helps you understand the difference between "Batch Art Finder" as an example with an ini section and other auto scripts.

I'm glad my other post made sense (as I hope this one does) I was a little concerned that it may have been taken the wrong way (read argumentative :)) but it was just an extended explaination as this is.

Look forward to the new release

onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Re: Right Click for Scripts (2008-04-05) [MM3]

Post by onenonymous » Sun Jul 06, 2008 4:19 pm

no worries - and thanks for the explanation. I wasn't thinking about you putting your menu items in a different place already. Let me know if my update doesn't work for any reason - although it should since I practically copied it wholesale from your post. :)

onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Re: Right Click for Scripts (2008-04-05) [MM3]

Post by onenonymous » Mon Aug 18, 2008 9:04 pm

Script is updated.

Version 1.5 Update August 18, 2008 - Download the installer
-Added ability to create buttons or menus for any of the scripts that are loaded in the right-click menus.

Find the new functionality from the toolbar button:
Image
Select the menu item "Add Toolbar/Menu Buttons..." to open a form where you can create buttons or menus for any of the toolbars, menus or pop-menus. Picture below may be cropped, but there's an OK button on the bottom right. (Thanks to MoDementia for the code to add & remove rows!)
Image
Hopefully this is easy to understand once you try it. Please let me know what you think!

Eyal
Posts: 3110
Joined: Sun Jun 26, 2005 9:27 am
Location: Québec

Re: Right Click for Scripts (2008-04-05) [MM3]

Post by Eyal » Tue Aug 19, 2008 5:03 am

Wow!
I'm very impressed.

I need to try this.
Thank you onenonymous & MoDementia.
Skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Right Click for Scripts (2008-04-05) [MM3]

Post by nynaevelan » Tue Aug 19, 2008 8:05 am

One:

I selected the 0 for the last positions but my icons are all moving to the first position on the toolbar. I tried the standard and the search toolbars.
I had to pick section 4 for the search toolbar and section 5 for the standard toolbar in order for the icons to appear last.

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Re: Right Click for Scripts (2008-04-05) [MM3]

Post by onenonymous » Tue Aug 19, 2008 1:22 pm

nynaevelan wrote:One:

I selected the 0 for the last positions but my icons are all moving to the first position on the toolbar. I tried the standard and the search toolbars.
I had to pick section 4 for the search toolbar and section 5 for the standard toolbar in order for the icons to appear last.

Nyn
Well that's certainly not consistent with my testing. Can you try 0 again then re-start MM to see if they show in the right place? If not, I'll have to do some digging to see what's going on. I did see some confusing results when I created buttons and added separators. It reads each row in the form and adds buttons and separators before going to the next row. So if you also add separators, that could make it appear that the buttons go in the wrong place. Using 0 though should put it at the end regardless, so :-?

Any one else who may try this, please let me know your experience.

thanks
~One

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Right Click for Scripts (2008-04-05) [MM3]

Post by nynaevelan » Tue Aug 19, 2008 1:39 pm

onenonymous wrote:
Well that's certainly not consistent with my testing. Can you try 0 again then re-start MM to see if they show in the right place?
I tried that before posting.
onenonymous wrote:If not, I'll have to do some digging to see what's going on. I did see some confusing results when I created buttons and added separators. It reads each row in the form and adds buttons and separators before going to the next row. So if you also add separators, that could make it appear that the buttons go in the wrong place. Using 0 though should put it at the end regardless, so :-?

Any one else who may try this, please let me know your experience.

thanks
~One
I didn't try the separaters but I do have buttons from other scripts, do you think that might have a factor? The script buttons are: Album Art Tagger, Repeat Current Song, AutorateAccurate, Backup, Batch Art Finder, MonkeyRok, My Custom Nodes, Playlist Song Replacer, Previewer, Right Click for Reports and Right Click for Scripts.

Here is a pic of my options and the results both before and after restarting MM:

Image

Image

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Re: Right Click for Scripts (2008-04-05) [MM3]

Post by onenonymous » Tue Aug 19, 2008 4:17 pm

Not sure what's going on. The buttons will be added one-by-one based on their order in the form. When you restart MM, any buttons loaded by scripts loaded before RCFS will already be on the toolbar, however scripts loaded after RCFS will load their buttons based on state of the toolbar when RCFS is done loading. Not sure if that impacts what's going on here. Also, I never tried with any skins other than Glided - so maybe there's some interaction there - don't know - just guessing. Which skin are you using in your screenshots? I'll load it and see if it makes a difference on mine. I notice it looks like the letter "S" after the separator checkboxes - those shouldn't be there, so maybe something is going on with the skin.

Other than where the buttons show up, is everything else working?
~One

PS - Gene Autry - Here Comes Santa Claus??? Now that's eclectic taste... :wink:

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Right Click for Scripts (2008-04-05) [MM3]

Post by nynaevelan » Tue Aug 19, 2008 4:27 pm

onenonymous wrote:Not sure what's going on. The buttons will be added one-by-one based on their order in the form. When you restart MM, any buttons loaded by scripts loaded before RCFS will already be on the toolbar, however scripts loaded after RCFS will load their buttons based on state of the toolbar when RCFS is done loading. Not sure if that impacts what's going on here. Also, I never tried with any skins other than Glided - so maybe there's some interaction there - don't know - just guessing. Which skin are you using in your screenshots? I'll load it and see if it makes a difference on mine. I notice it looks like the letter "S" after the separator checkboxes - those shouldn't be there, so maybe something is going on with the skin.
I am using DreadM's Agora skin. I noticed those S's also, but I thought that was the text for "Separator".
onenonymous wrote:Other than where the buttons show up, is everything else working?
~One
Yes it is working perfectly, I am scanning my computer now to see if I have some colorful icons. Your scripts are making me even lazier than I was before. :wink: Thanks for the update.

onenonymous wrote:PS - Gene Autry - Here Comes Santa Claus??? Now that's eclectic taste... :wink:
Yes, that goes in my nostalgic Christmas collection, nothing brings back fond memories like some early 20th century Christmas music, of course they were all made before I was born. :wink:

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Re: Right Click for Scripts -with buttons! (2008-18-08) [MM3]

Post by onenonymous » Wed Aug 20, 2008 6:45 pm

Nyn - I think it's working as designed. I loaded the Agora skin, and create buttons to match the ones in your screenshot - got the same result- which is as designed. Your screen shot for the form shows all buttons going in section 0 - which is the last section of the toolbar. Within the last section of standard toolbar, they go in as buttons 1, 2, & 3 - which is what your screenshot shows. For the search toolbar, I get the same results as you - but don't know what the buttons between button with icon "6" and "Web Lookup" are for in your screenshot. Which scripts are those from?

The "Order" spinedits (what you show as 1,2,3,4,5 & 6) set where within the section the buttons appear. Any button added after my script runs will place itself where the later script decides. Also, as I mentioned previously, my buttons load in order as shown on the form, so that can also impact where the buttons appear. If you choose an order # that is greater than the number of buttons already loaded, then the button just goes in as the last button. Later buttons could go in as last at the time they load. Hope that's clear - it got confusing to me as I was working this up.

Also - found the cause of the "S" behind the checkboxes. I'll fix that in the next update. I want to get feedback from other users before putting that out though. In the meantime, if they bother you, add the line with .Caption="" into the following 2 sections:

Code: Select all

		set ChkBxSepBefore = SDB.UI.NewCheckBox(FormQB)
		With ChkBxSepBefore
			.Common.SetRect 443,h,21,21
			.Common.Anchors = 1 + 2
			.Common.ControlName = "SepBefore" & iCounter
			If boolFoundBtnCode Then
				.Checked = arrButtonInfo(7)
			else
				.Checked = 0
			End If	
			.Common.Hint = "Insert a separator before this item"
			.Caption = ""
		end with

		set ChkBxSepAfter = SDB.UI.NewCheckBox(FormQB)
		With ChkBxSepAfter
			.Common.SetRect 469,h,21,21
			.Common.Anchors = 1 + 2
			.Common.ControlName = "SepAfter" & iCounter
			If boolFoundBtnCode Then
				.Checked = arrButtonInfo(8) 
			else
				.Checked = 0
			End If	
			.Common.Hint = "Insert a separator after this item"
			.Caption = ""
		end with
As usual, thanks for the enthusiastic response to this! :P

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Right Click for Scripts -with buttons! (2008-18-08) [MM3]

Post by nynaevelan » Wed Aug 20, 2008 7:03 pm

onenonymous wrote:Nyn - I think it's working as designed. I loaded the Agora skin, and create buttons to match the ones in your screenshot - got the same result- which is as designed. Your screen shot for the form shows all buttons going in section 0 - which is the last section of the toolbar. Within the last section of standard toolbar, they go in as buttons 1, 2, & 3 - which is what your screenshot shows. For the search toolbar, I get the same results as you - but don't know what the buttons between button with icon "6" and "Web Lookup" are for in your screenshot. Which scripts are those from?
Ok I am a little confused because you say they are attaching to the end of the standard toolbar, but they are in the middle. I only have two toolbars visible, the standard and the search. So how are they at the end, if they are in the middle??

The two icons on the search bar are from ZvevdanD's RegExp & Replace script.
onenonymous wrote:The "Order" spinedits (what you show as 1,2,3,4,5 & 6) set where within the section the buttons appear. Any button added after my script runs will place itself where the later script decides. Also, as I mentioned previously, my buttons load in order as shown on the form, so that can also impact where the buttons appear. If you choose an order # that is greater than the number of buttons already loaded, then the button just goes in as the last button. Later buttons could go in as last at the time they load. Hope that's clear - it got confusing to me as I was working this up.
That is as clear as mud :-? , but no nevermind, setting it to 5 for the standard bar and 4 for the search bar puts them where I want them to be.

onenonymous wrote:Also - found the cause of the "S" behind the checkboxes. I'll fix that in the next update. I want to get feedback from other users before putting that out though. In the meantime, if they bother you, add the line with .Caption="" into the following 2 sections:

Code: Select all

		set ChkBxSepBefore = SDB.UI.NewCheckBox(FormQB)
		With ChkBxSepBefore
			.Common.SetRect 443,h,21,21
			.Common.Anchors = 1 + 2
			.Common.ControlName = "SepBefore" & iCounter
			If boolFoundBtnCode Then
				.Checked = arrButtonInfo(7)
			else
				.Checked = 0
			End If	
			.Common.Hint = "Insert a separator before this item"
			.Caption = ""
		end with

		set ChkBxSepAfter = SDB.UI.NewCheckBox(FormQB)
		With ChkBxSepAfter
			.Common.SetRect 469,h,21,21
			.Common.Anchors = 1 + 2
			.Common.ControlName = "SepAfter" & iCounter
			If boolFoundBtnCode Then
				.Checked = arrButtonInfo(8) 
			else
				.Checked = 0
			End If	
			.Common.Hint = "Insert a separator after this item"
			.Caption = ""
		end with
As usual, thanks for the enthusiastic response to this! :P
I'm patient enough to wait for the update, I have the buttons I want added, so there isn't any need for me to go into the setup screen. I changed my icons to ones that are included in Gege's Silk Icon collection, here's a screen print, they are the last three on both toolbars.

Image

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Right Click for Scripts -with buttons! (2008-18-08) [MM3]

Post by nynaevelan » Wed Aug 20, 2008 7:06 pm

BTW, is there a way to "hide" MM delivered icons from the toolbars?

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Re: Right Click for Scripts -with buttons! (2008-18-08) [MM3]

Post by onenonymous » Wed Aug 20, 2008 7:35 pm

I'm glad it's working for you one way or the other :-? I don't know any way to hide MM standard buttons. If we knew what their object name was, we might be able to hide them. If it's buttons from other scripts, you could edit those scripts to not show a button.

Post Reply