Old 08-26-2018, 08:07 AM   #1
bFooz
Human being with feelings
 
Join Date: Jul 2010
Location: Slovakia
Posts: 2,588
Default Script: Dropdown menu

EDIT 2023-10-24

This script takes any Reaper's native menu or toolbar and shows it as a dropdown menu.

There are two script files attached in this post. The "... - Main file" file is what tou are going to duplicate and modify depending on the toolbar you want to use.

How to:
- download the two files and load them into Reaper's action list


- open the "Customize menus/toolbars" window, find the toolbar you want to use as a dropdown and remember its name, e.g. "Floating MIDI toolbar 2". Here you can also rename the actions in the toolbar and that will be shown in the dropdown.


- duplicate the "... - Main file" script file, you may rename it for you convenience and load it as an action into Reaper's action list

- open the new duplicated file and on the top, change the variable menuName to the name of the toolbar. Save. e.g.


- now each time you run this action, the drop down menu is going to show up and you can run commands from it as you would expect.

- you can now assign this action to another toolbar as a button, so when you press the button, the dropdown will show up. You can rename this action and that will be shown as a button text.
Attached Files
File Type: lua bfo - Toolbar dropdown - Main file.lua (775 Bytes, 91 views)
File Type: lua bfo_Toolbar dropdown - functions.lua (3.6 KB, 85 views)

Last edited by bFooz; 10-25-2023 at 12:49 AM.
bFooz is offline   Reply With Quote
Old 08-26-2018, 10:45 AM   #2
Regisfofo
Human being with feelings
 
Regisfofo's Avatar
 
Join Date: Mar 2017
Location: France
Posts: 627
Default

wow, that seems helpful!

thanks a lot for sharing!
Regisfofo is offline   Reply With Quote
Old 08-26-2018, 12:43 PM   #3
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,903
Default

Very Cool!
THANKS!

I think I found a minor bug.
In a menu the first two menu items for a toolbar I get is,

selected.png
item.png

Which seem to actually be the names of toolbar icons that have spaces in their name...
icon_23=toolbar_show selected.png
icon_28=toolbar_zoom_selected item.png

Not a big deal, I think I figured out how to filter out menu items I don't want by action # and names anyway.
Thanks again!

Last edited by Edgemeal; 08-26-2018 at 05:50 PM.
Edgemeal is offline   Reply With Quote
Old 09-01-2018, 11:13 AM   #4
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 633
Default

Hmm, when I run your floating midi toolbar I get:

bfo_Toolbar dropdown - functions.lua:44: bad argument #1 to 'find' (string expected, got nil)

Which is weird, because it looks like there are only 19 lines of code. Edit: I see, it's in find title in functions.Lua

What am I doing wrong? These licecaps make my head spin :P
__________________
eric moon
Very Stable Genius
https://gogolab.com/
woodslanding is offline   Reply With Quote
Old 09-01-2018, 12:36 PM   #5
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 1,719
Default

Thanks bFooz,

Very handy!!! Thanks for doing this and sharing!!

I also like your blue back-lit icons. Where did you get those?

Thanks again.
__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 • Catalina • Mac Mini 2020 6 core i7 • 64GB RAM • OS: Catalina • 4K monitor • RME RayDAT card with Sync Card and extended Light Pipe.
Thonex is offline   Reply With Quote
Old 09-01-2018, 03:53 PM   #6
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,903
Default

Quote:
Originally Posted by woodslanding View Post
Hmm, when I run your floating midi toolbar I get:

bfo_Toolbar dropdown - functions.lua:44: bad argument #1 to 'find' (string expected, got nil)
Not sure this helps but,
In a nut shell, The script can only work for toolbars that are in your 'reaper-menu.ini' file, and REAPER only adds toolbars to that ini file if you edit them (added buttons, etc).

So for example the posted script says,
menuName = "Floating MIDI toolbar 2"

If you never added anything to "MIDI 2" toolbar (a.k.a "Floating MIDI toolbar 2") then its not going to be found and script throws that error 44 message.
Edgemeal is offline   Reply With Quote
Old 09-01-2018, 09:29 PM   #7
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 633
Default

oh, cool, thanks. Thought I could get it to work with the fx menu, but that's not a customizable menu
__________________
eric moon
Very Stable Genius
https://gogolab.com/
woodslanding is offline   Reply With Quote
Old 09-03-2018, 12:59 PM   #8
bFooz
Human being with feelings
 
Join Date: Jul 2010
Location: Slovakia
Posts: 2,588
Default

Quote:
Originally Posted by woodslanding View Post
Hmm, when I run your floating midi toolbar I get:

bfo_Toolbar dropdown - functions.lua:44: bad argument #1 to 'find' (string expected, got nil)
I have uploaded the fixed version of "functions" file to the first post, please replace the old version with that one.
bFooz is offline   Reply With Quote
Old 09-03-2018, 01:01 PM   #9
bFooz
Human being with feelings
 
Join Date: Jul 2010
Location: Slovakia
Posts: 2,588
Default

Quote:
Originally Posted by Thonex View Post
I also like your blue back-lit icons. Where did you get those?
It's RADO V4 theme.
bFooz is offline   Reply With Quote
Old 09-04-2018, 07:15 AM   #10
zookthespook
Human being with feelings
 
Join Date: Mar 2015
Location: India Mumbai
Posts: 816
Default

This is so so good @
thank you for this
zookthespook is offline   Reply With Quote
Old 01-12-2019, 02:25 AM   #11
Vagelis
Human being with feelings
 
Vagelis's Avatar
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 3,782
Default

Nice one thanks!!

Is it possible to detect the icon when mouse is over with a script and change next or previous action from the toolbar with mousewheel?

Last edited by Vagelis; 01-12-2019 at 02:36 AM.
Vagelis is offline   Reply With Quote
Old 01-12-2019, 03:12 AM   #12
bFooz
Human being with feelings
 
Join Date: Jul 2010
Location: Slovakia
Posts: 2,588
Default

Quote:
Originally Posted by Vagelis View Post
Is it possible to detect the icon when mouse is over with a script and change next or previous action from the toolbar with mousewheel?
I don't see where the action would be changed. You always have to click at least two times in order to run an action from this. First time you click on a toolbar icon, which opens a menu, and the second time you click the menu item.

Regarding changing the toolbar button text or icon by a script, I haven't found a way to do this, probably not possible at the moment.
bFooz is offline   Reply With Quote
Old 01-12-2019, 04:46 AM   #13
Vagelis
Human being with feelings
 
Vagelis's Avatar
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 3,782
Default

I see thank you,anyway this is still useful as it is.
Vagelis is offline   Reply With Quote
Old 01-12-2019, 10:45 AM   #14
Coachz
Human being with feelings
 
Coachz's Avatar
 
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,762
Default

I made a toolbar (toolbar 7) and then renamed the script and the
menuName = "Floating MIDI toolbar 7"

When I run the script I don't get a dropdown. Am I totally lost ? he he Thanks for any help.

Coachz is offline   Reply With Quote
Old 01-12-2019, 11:17 AM   #15
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,903
Default

Quote:
Originally Posted by Coachz View Post
I made a toolbar (toolbar 7) and then renamed the script and the
menuName = "Floating MIDI toolbar 7"

When I run the script I don't get a dropdown. Am I totally lost ? he he Thanks for any help.
Been awhile since I tried that script but that doesn't look like a "MIDI toolbar", try,
menuName = "Floating toolbar 7"
Edgemeal is offline   Reply With Quote
Old 01-12-2019, 12:38 PM   #16
Coachz
Human being with feelings
 
Coachz's Avatar
 
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,762
Default

You are right. So I got it working I think but I"m confused. I put buttons on the toolbar and then put a button pointing to the script. Is the intention to put the dropdown buttons on one toolbar and then put a button that runs this script on another toolbar ?

That would mean If I wanted a toolbar with 5 drop downs I'd have to use 5 other toolbars to make them ?

Also, do I have to manually run this everytime Reaper opens to get this ?

Coachz is offline   Reply With Quote
Old 01-12-2019, 01:05 PM   #17
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,903
Default

Quote:
Originally Posted by Coachz View Post
You are right. So I got it working I think but I"m confused. I put buttons on the toolbar and then put a button pointing to the script. Is the intention to put the dropdown buttons on one toolbar and then put a button that runs this script on another toolbar ?
Well you'd call the script from say toolbar1 to show say toolbar5, Basically the script allows you to access toolbar actions from a different toolbar and displays their actions in a menu. I've unsub'd from this thread since I don't use this script, Good Luck!
Edgemeal is offline   Reply With Quote
Old 01-12-2019, 01:26 PM   #18
Coachz
Human being with feelings
 
Coachz's Avatar
 
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,762
Default

Thanks, I can't see me using it if I have to run the script every session to get the dropdown to populate though. :-(
Coachz is offline   Reply With Quote
Old 01-12-2019, 02:05 PM   #19
bFooz
Human being with feelings
 
Join Date: Jul 2010
Location: Slovakia
Posts: 2,588
Default

Quote:
Originally Posted by Coachz View Post
Is the intention to put the dropdown buttons on one toolbar and then put a button that runs this script on another toolbar ?

That would mean If I wanted a toolbar with 5 drop downs I'd have to use 5 other toolbars to make them ?
Yes, exactly. It would be completely possible to create custom menus though. Maybe try to ask in the script request forum if anyone would be into that. Pretty easy stuff to code.

Quote:
Also, do I have to manually run this everytime Reaper opens to get this ?
If you want to show the dropdown menu, you have to run the script manually, preferably by clicking the toolbar button assigned to it.
bFooz is offline   Reply With Quote
Old 01-12-2019, 02:40 PM   #20
Coachz
Human being with feelings
 
Coachz's Avatar
 
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,762
Default

I see. Thank you for clarifying.
Coachz is offline   Reply With Quote
Old 09-28-2019, 04:40 AM   #21
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,215
Default

Very nice bFooz
@Arthur McArthur told me about it https://forum.cockos.com/showpost.ph...postcount=1969
I think I can use this to display some custom menus in Track Inspector
Thank you!
heda is offline   Reply With Quote
Old 09-28-2019, 05:32 AM   #22
bFooz
Human being with feelings
 
Join Date: Jul 2010
Location: Slovakia
Posts: 2,588
Default

Thanks. Feel free.

I was thinking about expanding this to not only show the native menus, but to be able to create/read new custom menus. If you move into this direction and will think it is shareable as a standalone thing, let me know.
bFooz is offline   Reply With Quote
Old 10-27-2019, 10:08 AM   #23
strachupl
Human being with feelings
 
strachupl's Avatar
 
Join Date: Jan 2013
Posts: 646
Default

Hi. Is it possible to make dropdown menu with acrions/scripts listed instead of toolbar content?
__________________
Love is patient and kind; love does not envy or boast; it is not arrogant or rude.
It does not insist on its own way; it is not irritable or resentful;
it does not rejoice at wrongdoing, but rejoices with the truth. Corinthians 13:4-6
strachupl is offline   Reply With Quote
Old 10-27-2019, 11:11 AM   #24
bFooz
Human being with feelings
 
Join Date: Jul 2010
Location: Slovakia
Posts: 2,588
Default

This would be easily possible, but is not implemented in this script.
bFooz is offline   Reply With Quote
Old 11-04-2019, 02:32 PM   #25
kudlatiy
Human being with feelings
 
Join Date: Jul 2015
Posts: 54
Default

thanks a lot! super needed feature
kudlatiy is offline   Reply With Quote
Old 11-04-2019, 02:39 PM   #26
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Quote:
Originally Posted by bFooz View Post
This would be easily possible, but is not implemented in this script.
If it helps, v3 of my GUI adds a module with functions to help with generating menus for gfx.showmenu and parsing the output, since it gets a little weird with subfolders or separators.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 11-10-2019, 03:48 AM   #27
Vagelis
Human being with feelings
 
Vagelis's Avatar
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 3,782
Default

I love this script, I made a toolbar with different options for splitting-trimming the items.i d like to ask, would it be possible to show the icons from the toolbar in the dropdownmenu? That would be awesome
Vagelis is offline   Reply With Quote
Old 11-10-2019, 06:55 AM   #28
bFooz
Human being with feelings
 
Join Date: Jul 2010
Location: Slovakia
Posts: 2,588
Default

Quote:
Originally Posted by Vagelis View Post
would it be possible to show the icons from the toolbar in the dropdownmenu? That would be awesome
Not at the moment. The current API does not allow that.
bFooz is offline   Reply With Quote
Old 11-13-2019, 03:42 AM   #29
Ivannn Bennnettt
Human being with feelings
 
Join Date: Feb 2017
Posts: 305
Default

Quote:
Originally Posted by Vagelis View Post
I love this script, I made a toolbar with different options for splitting-trimming the items.i d like to ask, would it be possible to show the icons from the toolbar in the dropdownmenu? That would be awesome
but you could use a unicode http://xahlee.info/comp/unicode_emoticons.html
Ivannn Bennnettt is offline   Reply With Quote
Old 11-13-2019, 04:02 AM   #30
bFooz
Human being with feelings
 
Join Date: Jul 2010
Location: Slovakia
Posts: 2,588
Default

Quote:
Originally Posted by Ivannn Bennnettt View Post
Most of these are not being displayed in menus. There are some characters however that are being displayed and can be usefull, for example

↖ ↗ ‖ ★ ▶ ➜

bFooz is offline   Reply With Quote
Old 11-13-2019, 09:21 AM   #31
Ivannn Bennnettt
Human being with feelings
 
Join Date: Feb 2017
Posts: 305
Default

Quote:
Originally Posted by bFooz View Post
Most of these are not being displayed in menus.
Yep, I thought it's only I have. It needs to dig.
I've found another one http://charbase.com/block/dingbats
Ivannn Bennnettt is offline   Reply With Quote
Old 11-13-2019, 09:23 AM   #32
Vagelis
Human being with feelings
 
Vagelis's Avatar
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 3,782
Default

Thanks, I had no idea about Unicode. But where should I add it to show up?
Vagelis is offline   Reply With Quote
Old 11-13-2019, 09:26 AM   #33
bFooz
Human being with feelings
 
Join Date: Jul 2010
Location: Slovakia
Posts: 2,588
Default

I just find a character on web and copy-paste it into Reaper.
bFooz is offline   Reply With Quote
Old 11-13-2019, 09:33 AM   #34
Vagelis
Human being with feelings
 
Vagelis's Avatar
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 3,782
Default

Nice I will check that out.
Vagelis is offline   Reply With Quote
Old 11-13-2019, 09:37 AM   #35
Ivannn Bennnettt
Human being with feelings
 
Join Date: Feb 2017
Posts: 305
Default

and one more http://decodeunicode.org/en/u+1D122
Ivannn Bennnettt is offline   Reply With Quote
Old 12-02-2019, 08:33 AM   #36
Vagelis
Human being with feelings
 
Vagelis's Avatar
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 3,782
Default

I'd like to ask if it is possible to toggle open/close the dropdown menu when i click the toolbar button or assign it to a key. It would be even more useful thanks!
Vagelis is offline   Reply With Quote
Old 12-02-2019, 09:25 AM   #37
bFooz
Human being with feelings
 
Join Date: Jul 2010
Location: Slovakia
Posts: 2,588
Default

Quote:
Originally Posted by Vagelis View Post
I'd like to ask if it is possible to toggle open/close the dropdown menu when i click the toolbar button or assign it to a key. It would be even more useful thanks!
To toggle probably not.

The script uses this function https://www.extremraym.com/cloud/rea...a_gfx.showmenu which invokes the standard OS menu, which hides itself when it detects a user input. I can't think of a straightforward way to hide it programatically.

To assign it to a key yes, you can do it the same way as with any ohter action in the in the action window.
bFooz is offline   Reply With Quote
Old 12-02-2019, 09:41 AM   #38
Vagelis
Human being with feelings
 
Vagelis's Avatar
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 3,782
Default

Ahh i see, i was hoping if it would be possible since i'm using it a lot, but that's a small thing compared to the usability it offers.
Vagelis is offline   Reply With Quote
Old 12-02-2019, 10:23 AM   #39
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

The dropdown also pauses the script while it's open, so the script can't close it.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 12-16-2019, 08:45 AM   #40
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,114
Default

thanks a whole lot, bFooz, the script is bananas, simplifies quite a few things
Buy One is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:21 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.