Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Feature Requests

Reply
 
Thread Tools Display Modes
Old 02-19-2019, 09:38 PM   #41
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
Default

Quote:
Originally Posted by Moy View Post
That's AMAZING, thank you Edgemeal !! <3
No problem,
You should Thank (donate) juliansader!
Edgemeal is offline   Reply With Quote
Old 02-22-2019, 06:15 AM   #42
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
Default

Quote:
Originally Posted by semikid View Post
Is there a way to make it specific to the "media explorer" actions rather than the "main actions"?
This seems to work OK as long as the media explorer has focus (obviously) and (strangely) the Actions window is not open to the Media Explorer section. Tested using F3 and Control+F as hotkeys.

EDIT REAPER has added a shortcut to the Media Explorer section to do this, and is currently in pre-release version...
v6.42+dev1122 - November 22 2021
+ Media explorer: add action to focus search field, control+ (or command+) F by default


Code:
-- For Media Explorer actions.

local title = reaper.JS_Localize("Media Explorer", "common")
local explorer = reaper.JS_Window_Find(title, true)
local search = reaper.JS_Window_FindChildByID(explorer, 1015) 
if search then
 reaper.JS_Window_SetFocus(search) 
end
reaper.defer(function () end)

Last edited by Edgemeal; 12-05-2021 at 08:04 PM.
Edgemeal is offline   Reply With Quote
Old 02-24-2019, 09:58 AM   #43
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
Default

Quote:
Originally Posted by _Stevie_ View Post
@Edgemeal, how do you find the codes for the window elements (like the search box)?
Just saw Julian post about GetLongPtr in his api thread. I didn't know you could get control id from his api, cool!

Code:
-- Get Control ID under mouse
local x,y = reaper.GetMousePosition()
local hwnd = reaper.JS_Window_FromPoint(x,y)
local id = reaper.JS_Window_GetLongPtr(hwnd, "ID")
reaper.ShowConsoleMsg(tostring(id) .. "\n"

Last edited by Edgemeal; 02-27-2019 at 08:28 AM.
Edgemeal is offline   Reply With Quote
Old 02-28-2019, 03:34 PM   #44
EpicSounds
Human being with feelings
 
EpicSounds's Avatar
 
Join Date: Jul 2009
Posts: 7,592
Default

Quote:
Originally Posted by _Stevie_ View Post
I wish, got the same problem with the resource window. Tab just doesn't jump to the first entry. It goes everywhere, but not to the list :P
i don't know if anything changed in the background to get this working since I last tried but today it works like this

cmd-f, type search string, enter/return, tab x2, then arrow keys work in search results.
__________________
REAPER Video Tutorials, Tips & Tricks and more at The REAPER Blog
EpicSounds is offline   Reply With Quote
Old 03-26-2019, 11:02 AM   #45
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,820
Default

this is awesome! i have a short cut for this action , ..

i have 2 questions:
- is it possible to change the script so that same shortcut still toggles open and close.
Because at this moment the script just opens! seems like when focus is on search , .. shortcut does not work. Seems natural in some way ,.. i tried changing the code but couldn't find a solution ...

- is it possible to call some action onMouseClick in this search box? : )

Thank you for the examples Edgemeal and ofcourse thank you JS!
This is FUN! wawau!
deeb is online now   Reply With Quote
Old 03-26-2019, 03:51 PM   #46
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
Default

Quote:
Originally Posted by deeb View Post
seems like when focus is on search , .. shortcut does not work.
Right, seems to be by design, for example I have Control+A to select all files in Media Explorer but if focus is on search textbox the shortcut doesn't do anything. Would probably need to launch scripts from toolbar buttons.
Edgemeal is offline   Reply With Quote
Old 03-26-2019, 11:59 PM   #47
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,820
Default

yep! Thank you!

2 things that come in mind!

- is it possible to call some action onMouseClick in this search box? : )

So that i can open a GUI on mouse click

and also:
- is it possible to "hack" and "simulate" a mouse event by scripting without actually using the mouse? something like makeEvent("mouseClick", window) :P

just an example use case: a way to automatically do all this steps in a selected file:

deeb is online now   Reply With Quote
Old 03-27-2019, 01:43 AM   #48
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
Default

That probably isn't possible, you can send mouse click messages to simulate a user clicking on some things but lua scripts stop running when input dialog windows are shown and only continue when the dialogs are closed, its one reason why I write some stuff as a Windows exe.

Do you know anything about how windows messages work? I wouldn't even know where to start, maybe read some of this...
https://docs.microsoft.com/en-us/win...message-queues

If you understand all that then you know a lot more than me!

Not sure it helps but the lua scripts I did for MIDI Quantize and Dynamic Split presets do a lot of window message stuff, clicking, get/send text, very basic stuff and can probably be improved too.
Edgemeal is offline   Reply With Quote
Old 03-27-2019, 02:43 AM   #49
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,820
Default

Quote:
Originally Posted by Edgemeal View Post
That probably isn't possible, you can send mouse click messages to simulate a user clicking on some things but lua scripts stop running when input dialog windows are shown and only continue when the dialogs are closed, its one reason why I write some stuff as a Windows exe.
i see yes it's a bit too much ! maybe not extensions? maybe is the same ...


Quote:
Originally Posted by Edgemeal View Post
Do you know anything about how windows messages work? I wouldn't even know where to start, maybe read some of this...
https://docs.microsoft.com/en-us/win...message-queues

If you understand all that then you know a lot more than me!
not at all : ) the only thing i know is that i know nothing about it! and i have no time to dig about that at the moment ! but still it's an idea i might explore later ... or not , .. most probably not

Quote:
Originally Posted by Edgemeal View Post

Not sure it helps but the lua scripts I did for MIDI Quantize and Dynamic Split presets do a lot of window message stuff, clicking, get/send text, very basic stuff and can probably be improved too.
It's good for using and as a reference! ; ) thanks
deeb is online now   Reply With Quote
Old 04-29-2019, 04:49 AM   #50
Moy
Human being with feelings
 
Moy's Avatar
 
Join Date: Oct 2017
Location: China
Posts: 60
Default

Quote:
Originally Posted by Edgemeal View Post
MS SPY++ (shown below) or similar utility that displays the Control ID,..



Some controls will be inside other controls, look up the tree to get the properties of their parent control, or what I called the container in the code above.

I made a simple Windows app for top-level windows too.
Hi @Edgemeal , Any Chance to focus on specific "shortcut" or "database"?
I've used SpyXX to check the part, and found that the whole "list" is ONE part, so.. Could there be any way to choose one of them?
__________________
Nice to meet REAPER.
My Chinese tutorials of RAEPER: https://zhuanlan.zhihu.com/reaper
Moy is offline   Reply With Quote
Old 04-29-2019, 11:45 AM   #51
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
Default

Quote:
Originally Posted by Moy View Post
Hi @Edgemeal , Any Chance to focus on specific "shortcut" or "database"?
I've used SpyXX to check the part, and found that the whole "list" is ONE part, so.. Could there be any way to choose one of them?
Not sure how well it will work, I only have very short list to test with, testing from code window.


Last edited by Edgemeal; 04-30-2019 at 09:49 AM. Reason: See Post #58 For Updated Script
Edgemeal is offline   Reply With Quote
Old 04-29-2019, 02:10 PM   #52
EpicSounds
Human being with feelings
 
EpicSounds's Avatar
 
Join Date: Jul 2009
Posts: 7,592
Default

That's neat. I could see using alpha 1-10 to jump through my folders and databases.

perhaps you can do that thing where the script fills in a string from it's own name?

edit - wasn't able to get this working on macOS from main or media explorer action list.
__________________
REAPER Video Tutorials, Tips & Tricks and more at The REAPER Blog

Last edited by EpicSounds; 04-29-2019 at 02:17 PM.
EpicSounds is offline   Reply With Quote
Old 04-29-2019, 02:26 PM   #53
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
Default

Quote:
Originally Posted by EpicSounds View Post
edit - wasn't able to get this working on macOS from main or media explorer action list.
Tested on Win7 only.

Last edited by Edgemeal; 04-29-2019 at 02:33 PM.
Edgemeal is offline   Reply With Quote
Old 04-30-2019, 02:35 AM   #54
Moy
Human being with feelings
 
Moy's Avatar
 
Join Date: Oct 2017
Location: China
Posts: 60
Default

Quote:
Originally Posted by Edgemeal View Post
Not sure how well it will work, I only have very short list to test with, testing from code window.

WOW That's so.. amazing!
And it works GREAT in my PC!!!

Thank you!!! The idea and script are both genius!!!
__________________
Nice to meet REAPER.
My Chinese tutorials of RAEPER: https://zhuanlan.zhihu.com/reaper
Moy is offline   Reply With Quote
Old 04-30-2019, 02:55 AM   #55
Moy
Human being with feelings
 
Moy's Avatar
 
Join Date: Oct 2017
Location: China
Posts: 60
Default

Quote:
Originally Posted by EpicSounds View Post
That's neat. I could see using alpha 1-10 to jump through my folders and databases.

perhaps you can do that thing where the script fills in a string from it's own name?

edit - wasn't able to get this working on macOS from main or media explorer action list.
In the script Edgemeal used "Virtual Key" - which is only supported in Windows system, that's why the macOS could not use it.

And as far as I can see, the JS_Library only support JS_WindowMessage_Send currently. Maybe you could contact the developer (juliansader) and try to find out some way to support macOS version of "Send Virtual Key" Function ? : )
__________________
Nice to meet REAPER.
My Chinese tutorials of RAEPER: https://zhuanlan.zhihu.com/reaper
Moy is offline   Reply With Quote
Old 04-30-2019, 06:00 AM   #56
Moy
Human being with feelings
 
Moy's Avatar
 
Join Date: Oct 2017
Location: China
Posts: 60
Default

Quote:
Originally Posted by Edgemeal View Post
Tested on Win7 only.
Hi @Edgemeal, do you have a Paypal link?
I wanna donate for this GREAT script!
Not so much, maybe could buy you a Coffee

(BTW I've donated js before )



And I modified it a little, so that after locate specific database, it will automatically focus to the search box.
(Yes, based on your 2 scripts)
Attached Files
File Type: lua Moy_Go To [Libraries].lua (3.8 KB, 186 views)
__________________
Nice to meet REAPER.
My Chinese tutorials of RAEPER: https://zhuanlan.zhihu.com/reaper
Moy is offline   Reply With Quote
Old 04-30-2019, 06:01 AM   #57
Moy
Human being with feelings
 
Moy's Avatar
 
Join Date: Oct 2017
Location: China
Posts: 60
Default

Quote:
Originally Posted by Moy View Post
Hi @Edgemeal, do you have a Paypal link?
I wanna donate for this GREAT script!
Not so much, maybe could buy you a Coffee

(BTW I've donated js before )



And I modified it a little, so that after locate specific database, it will automatically focus to the search box.
(Yes, based on your 2 scripts)
And I found that if you assign hotkey with "Alt", the Script would not functional as usual.
__________________
Nice to meet REAPER.
My Chinese tutorials of RAEPER: https://zhuanlan.zhihu.com/reaper
Moy is offline   Reply With Quote
Old 05-01-2019, 06:06 AM   #58
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
Default

Quote:
Originally Posted by Moy View Post
And I found that if you assign hotkey with "Alt", the Script would not functional as usual.
Good catch, Ya thats a quirk with sending keys from a script that is launched via key-shortcut, if modifier keys are used they may change how the control see's the keys and not work as expected. I'm not sure there is a good way around that. Chalk it up as a hack.

One idea around that problem was to check if user is still holding down a modifier key(s) before calling my main function. In other script where I send down-arrow keys I added this code as workaround, just in case I ever use Alt key with the script!

Code:
-- Since this script sends keys, any window that allows shortcuts to be passed thru,
-- may effect features due to a modifier key!
------------------------------------------------------------------------------------
-- If Control and/or Shift pressed then wait until keys are released!
::chkKeys::
cntrl = reaper.JS_Mouse_GetState(4)
shift = reaper.JS_Mouse_GetState(8)
if cntrl == 4 or shift == 8 then goto chkKeys end
-- If ALT key pressed the script won't work correctly, so warn and exit!
alt = reaper.JS_Mouse_GetState(16)
if alt == 16 then
  reaper.MB("Its best not to use ALT key to launch this script!", "WARNING", 0)
else
  Main()
end

Last edited by Edgemeal; 05-06-2019 at 10:09 AM.
Edgemeal is offline   Reply With Quote
Old 05-27-2019, 07:54 AM   #59
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

@Edgemeal
Hi,

For some reason it worked fined yesterday but not anymore when the explorer is docked. I didn't update anything.



I tried docking/undocking, but no success. :/


If seems search variable stay nil.






Any idea ?*

EDIT: weird, it works again now... :S
X-Raym is offline   Reply With Quote
Old 05-27-2019, 08:01 AM   #60
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

@edgemeal
I found the issue:
If undocked action list is set to context Media Explorer, then the script broke !! ^^


How could we handle that ?
X-Raym is offline   Reply With Quote
Old 06-14-2019, 07:58 AM   #61
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
Default

Quote:
Originally Posted by X-Raym View Post
@edgemeal
I found the issue:
If undocked action list is set to context Media Explorer, then the script broke !! ^^
How could we handle that ?
Thanks for the heads up!

Turns out the documentation for JS_Window_Find was incorrect (its been updated to v0.989), it also gets handles to child windows. I was also unaware of the OpenMediaExplorer function, it returns the handle of Media Explorer, so here is a re-write that should work better,....

For 'Main' actions list,
Code:
-- Set focus on Media Explorer search - June-14-2019

local explorer = reaper.OpenMediaExplorer("", false)
if not explorer then --not-docked and closed
  reaper.Main_OnCommand(50124, 0) -- Media explorer: Show/hide media explorer
  explorer = reaper.OpenMediaExplorer("", false)
end

local search = reaper.JS_Window_FindChildByID(explorer, 1015) 
if search then
  if not reaper.JS_Window_IsVisible(search) then -- when docked but not visible
    reaper.Main_OnCommand(50124, 0) -- Media explorer: Show/hide media explorer 
  end
  reaper.JS_Window_SetFocus(search)
end
If you want script for 'Media Explorer' actions list,..
Code:
-- Set focus on Media Explorer search 
-- NOTE: Media Explorer must have focus!

local explorer = reaper.OpenMediaExplorer("", false)
if explorer then
  local search = reaper.JS_Window_FindChildByID(explorer, 1015) 
  if search then reaper.JS_Window_SetFocus(search) end
end
Script for 'Main' actions list last tested on:
Win10 x64, REAPER v6.40, js_ReaScriptAPI v1.22
Note, the very first time Media Explorer is open REAPER sets focus on the folder list, so may need to call the script twice on the very first usage, after that it worked on first try here, FWIW I was using 'Control+F' as shortcut for script in testing.

Originally Tested on:
Win7, REAPER v5.979rc1/x64, js_ReaScriptAPI v0.987.
Win7, REAPER v5.979rc2/x64, js_ReaScriptAPI v0.989.

Last edited by Edgemeal; 11-05-2021 at 06:12 PM. Reason: Updated Notes
Edgemeal is offline   Reply With Quote
Old 01-12-2021, 12:18 PM   #62
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,820
Default

For 'Main' actions list,
Code:
-- Set focus on Media Explorer search - June-14-2019

local explorer = reaper.OpenMediaExplorer("", false)
if not explorer then --not-docked and closed
  reaper.Main_OnCommand(50124, 0) -- Media explorer: Show/hide media explorer
  explorer = reaper.OpenMediaExplorer("", false)
end

local search = reaper.JS_Window_FindChildByID(explorer, 1015) 
if search then
  if not reaper.JS_Window_IsVisible(search) then -- when docked but not visible
    reaper.Main_OnCommand(50124, 0) -- Media explorer: Show/hide media explorer 
  end
  reaper.JS_Window_SetFocus(search)
end
this broke i think in last Pre! which might be for a good reason tho
__________________
🙏🏻
deeb is online now   Reply With Quote
Old 01-12-2021, 12:33 PM   #63
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

I think field search have changed ID... try 1001 ?
X-Raym is offline   Reply With Quote
Old 01-12-2021, 12:33 PM   #64
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,107
Default

Quote:
Originally Posted by deeb View Post
For 'Main' actions list,
Code:
...
local explorer = reaper.OpenMediaExplorer("", false)
...
this broke i think in last Pre! which might be for a good reason tho
https://forum.cockos.com/showpost.ph...9&postcount=10
I think (hope) the devs will fix it.

edit
Seems fixed already in +dev0111 (but not in changelog).

edit2:
@X-Raym: I think 1015 is the combo box and 1001 is the text box (search field) inside it, hasn't changed afaik, script seems to work here with +dev0111.

Last edited by nofish; 01-12-2021 at 01:11 PM.
nofish is offline   Reply With Quote
Old 01-13-2021, 01:53 AM   #65
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,820
Default

yep Fixed! Thank you!
__________________
🙏🏻
deeb is online now   Reply With Quote
Old 11-15-2021, 07:41 AM   #66
Dragonetti
Human being with feelings
 
Join Date: Feb 2017
Location: Kiel
Posts: 974
Default

Quote:
-- Set focus on Media Explorer search - June-14-2019

local explorer = reaper.OpenMediaExplorer("", false)
if not explorer then --not-docked and closed
reaper.Main_OnCommand(50124, 0) -- Media explorer: Show/hide media explorer
explorer = reaper.OpenMediaExplorer("", false)
end

local search = reaper.JS_Window_FindChildByID(explorer, 1015)
if search then
if not reaper.JS_Window_IsVisible(search) then -- when docked but not visible
reaper.Main_OnCommand(50124, 0) -- Media explorer: Show/hide media explorer
end
reaper.JS_Window_SetFocus(search)
end
Is it possible to expand the script in such a way that DB: projectmanager is automatically selected and "rpp" is written in under search.
Thanks
Dragonetti is offline   Reply With Quote
Old 11-16-2021, 01:25 PM   #67
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
Default

Quote:
Originally Posted by Dragonetti View Post
Is it possible to expand the script in such a way that DB: projectmanager is automatically selected and "rpp" is written in under search.
Thanks
Hope this works for you (don't have large DB to test). Need to run script twice on very first usage if explorer hasn't been open since REAPER started (as noted in post # 61), after that it should set focus on the file list (OPTIONAL code at bottom of script), don't think we'd want it to focus on search field now.

Updated in post #69.

Last edited by Edgemeal; 11-19-2021 at 10:01 AM.
Edgemeal is offline   Reply With Quote
Old 11-17-2021, 12:16 PM   #68
Dragonetti
Human being with feelings
 
Join Date: Feb 2017
Location: Kiel
Posts: 974
Default

Works great, thank you very much
I will build a custom action to open the Media Explorer for the first time, then close it and open it again.

Markus
Dragonetti is offline   Reply With Quote
Old 11-21-2021, 02:28 PM   #69
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
Default Updated: Minor changes for v1.03

Quote:
Originally Posted by Dragonetti View Post
Works great, thank you very much
I will build a custom action to open the Media Explorer for the first time, then close it and open it again.
Updated, this one acts like the set focus on search field script above where it opens explorer and makes it visible! A short delay (see wait variable) gives explorer time to update before script sets the path and search text. Hopefully this works better, and also on the the very first usage, seems to be working great here.

Code:
-- Show Media Explorer, set path and search
-- v1.03 - Edgemeal - Nov 21, 2021
-- Donate: https://www.paypal.me/Edgemeal
--
-- Tested: Win10/x64, REAPER v6.41/x64 & v6.42+dev1118, js_ReaScriptAPI v1.22

-- USER SETTINGS -- USER SETTINGS -- USER SETTINGS -- USER SETTINGS --
local path = "DB: Projectmanager"
local search = ".rpp"

-- Give Media Explorer time to update when open.
local wait = 20 -- Higher number = longer wait time.
----------------------------------------------------------------------

Last edited by Edgemeal; 04-01-2022 at 06:34 AM.
Edgemeal is offline   Reply With Quote
Old 11-22-2021, 03:28 AM   #70
Dragonetti
Human being with feelings
 
Join Date: Feb 2017
Location: Kiel
Posts: 974
Default

awesome
thank you very much

maybe i wanted to add a special function.
in which line should I write that.
reaper.MainOnCommand(42122,0)--Randomize file list
Thanks
Dragonetti is offline   Reply With Quote
Old 11-22-2021, 09:59 AM   #71
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
Default

Quote:
Originally Posted by Dragonetti View Post
awesome
thank you very much

maybe i wanted to add a special function.
in which line should I write that.
reaper.MainOnCommand(42122,0)--Randomize file list
Thanks
Thanks for the donation!

After the search part is set it seems we need to give Explorer a little time to update/populate again or the 'Randomize file list' action wont do anything, so this script uses two wait variables Setting r_wait to 10 still worked and was faster here, but I also don't have many files. YMMV.

User settings near top...
local m_wait = 20 -- wait after open to set path and search.
local r_wait = 20 -- wait before calling randomize file list.


EDIT: Updated to v1.01 - r_wait variable was set in code!

Last edited by Edgemeal; 04-01-2022 at 06:34 AM.
Edgemeal is offline   Reply With Quote
Old 11-25-2021, 03:47 AM   #72
Dragonetti
Human being with feelings
 
Join Date: Feb 2017
Location: Kiel
Posts: 974
Default

Thank you
Strangely, when you start Reaper and Media Explorer for the first time, the same song always comes first. Should always be a different song.

edit: I will put the random file function on a toolbar button, that makes more sense.

Last edited by Dragonetti; 11-25-2021 at 03:43 PM.
Dragonetti is offline   Reply With Quote
Old 12-02-2021, 08:38 AM   #73
Dragonetti
Human being with feelings
 
Join Date: Feb 2017
Location: Kiel
Posts: 974
Default

@Edgemeal
Can you please change your script so that I can create a toolbar button with the script to define search terms.
In this example:
DB: Projectmanager
".rpp mark"
I would like to create several buttons with different search terms.
Thank you

Dragonetti is offline   Reply With Quote
Old 12-02-2021, 03:22 PM   #74
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
Default

Quote:
Originally Posted by Dragonetti View Post
@Edgemeal
Can you please change your script so that I can create a toolbar button with the script to define search terms.
In this example:
DB: Projectmanager
".rpp mark"
I would like to create several buttons with different search terms.
Thank you

One way would be to edit the script code so the search word is taken from the script filename, so at the top of the script I'd change it to look like this,...
Code:
-- USER SETTINGS -- USER SETTINGS -- USER SETTINGS -- USER SETTINGS --
local path = "DB: Projectmanager"
----------------------------------------------------------------------

 -- get name of script file.
local name = ({reaper.get_action_context()})[2]:match("([^/\\_]+)%.lua$") -- Thanks to cfillion!
-- get the search words after the " for " text.
local search = name:match(" for (.+)")
Then make copies of the script and rename them so they include the search text after the " for " in the filename, for example,
"Show Media Explorer, set path and search for .rpp mark.lua"
"Show Media Explorer, set path and search for Your Heart Is Mine.lua"

For the randomize scripts, maybe change their filenames like so?,..
"Show Media Explorer, set path, randomize files and search for .rpp mark.lua"
"Show Media Explorer, set path, randomize files and search for Your Heart Is Mine.lua"

BTW I suck at using Lua pattern matching to parse text, so you'll need to do some research and learn how to do that , but the code above did seem to work OK for the example filenames I used.

Last edited by Edgemeal; 12-02-2021 at 04:34 PM.
Edgemeal is offline   Reply With Quote
Old 12-02-2021, 05:23 PM   #75
Dragonetti
Human being with feelings
 
Join Date: Feb 2017
Location: Kiel
Posts: 974
Default

works wonderfully, but only with the last release.
Unfortunately, it doesn't work with the asterisks.
I copied these from here.

https://unicode-table.com/de/2605/
Maybe you have an idea.
Thanks
Dragonetti is offline   Reply With Quote
Old 12-02-2021, 07:18 PM   #76
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
Default

Seems REAPER doesn't support those "★" chars for searching here (Win10_x64 us_en, REAPER v6.41). Maybe ask the devs to support that. ?

FWIW, I can see the "★" char in filenames and Title metadata tags in REAPER, but in my audio player (MPC) and Windows Explorer details, they both show "★" chars as "â˜" when used for metadata.
Edgemeal is offline   Reply With Quote
Old 12-20-2021, 11:12 AM   #77
Dragonetti
Human being with feelings
 
Join Date: Feb 2017
Location: Kiel
Posts: 974
Default

That works fine with your script.
Dragonetti is offline   Reply With Quote
Old 12-20-2021, 11:59 AM   #78
EpicSounds
Human being with feelings
 
EpicSounds's Avatar
 
Join Date: Jul 2009
Posts: 7,592
Default

an update to my original feature request

reaper 6.43 adds the feature

in action list for media explorer
Browser: Search (focuses search field)


Lots of other cool stuff in this thread though. great work everyone
__________________
REAPER Video Tutorials, Tips & Tricks and more at The REAPER Blog
EpicSounds is offline   Reply With Quote
Old 02-22-2022, 08:49 AM   #79
Dragonetti
Human being with feelings
 
Join Date: Feb 2017
Location: Kiel
Posts: 974
Default

Hey
I organize my projects in Media Explorer using rendered mp3s. I have more options to add metadata etc.

Is it possible to load the appropriate .rpp for a selected .mp3?
Both have the same name and are in the same database.

The script must run:
1. Recognize the name of the selected mp3
2.rename the extension to.rpp
3. Enter in the search field
4.and load the found .rpp.

Thank you very much

Last edited by Dragonetti; 02-25-2022 at 06:23 AM.
Dragonetti is offline   Reply With Quote
Old 02-25-2022, 10:41 AM   #80
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
Default

Quote:
Originally Posted by Dragonetti View Post
Is it possible to load the appropriate .rpp for a selected .mp3?
Both have the same name and are in the same database.
When a DB is selected the path isn't displayed, might be possible to open the database and search by filename for a match, I really don't know, never tried that, good luck!
Edgemeal 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 01:36 AM.


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