Old 01-18-2018, 09:38 PM   #1
Nantho
Human being with feelings
 
Join Date: Mar 2013
Posts: 214
Default Help : reaper.GetUserInputs

Hi Folks !

I've got a question for you, I'm working on a script that need a user input so I'm trying to use the function reaper.GetUserInputs

First I've got a variable called FX, the default value is a string :

Code:
FX = "?"
Then there is a popup window asking for something :

Code:
fraise_string = tostring(FX)
reaper.GetUserInputs("Insert FX", 1, "Plug-in Name :", fraise_string)
Now i'm trying to store the value entered by the user into the FX variable :

Code:
if fraise_string then
FX = tostring(fraise_string)
end
But I don't why this last part doesn't work... When I'm trying to print the FX value into the console, it's showing the default value and not the new one... Any idea ?

Thanks
Nantho is offline   Reply With Quote
Old 01-19-2018, 12:30 AM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

GetUserInputs returns : boolean retval, string retvals_csv, it doesn't modify the passed in string.

So you need to do something like :

Code:
local rv, rv_str = reaper.GetUserInputs("Insert FX", 1, "Plug-in Name :", fraise_string)
if rv==true then
  FX = rv_str
  
end
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 01-19-2018, 02:54 AM   #3
Nantho
Human being with feelings
 
Join Date: Mar 2013
Posts: 214
Default

Oh God, you made my day !

It works like a charm now, thank you very much
Nantho 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 11:24 AM.


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