Old 10-13-2017, 06:11 PM   #1
Commala
Human being with feelings
 
Join Date: Feb 2014
Posts: 615
Default Script request? Reason project file launcher

Fairly simple in concept, just a way to automatically launch a particular Reason project file immediately after opening a Reaper project.

The point is basically to reduce the inconvenience of using Reason rewired with Reaper. You have to always open Reason after Reaper then navigate to the correct Reason project file that is associated with the Reaper project. What I'd really like is a way to automate this process, so that the Reason file will be associated to the Reaper project, and will automatically be launched when the Reaper project is loaded.

This may be outside the scope of scripting, but I figured I'd post here to see if anyone could help me out, either to code something like this or to give any information about how one could accomplish this.

Also I'd be willing to pay to have this done. Currently I'm always so reluctant to use Reason in a project because of having to do this, and I would love to be able to overcome this inconvenience.
Commala is offline   Reply With Quote
Old 10-14-2017, 02:14 PM   #2
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

Associate lua script
Code:
path = 'C:/file.txt'
if reaper.GetOS():find("OSX") then os.execute('open "" "' .. path .. '"') else os.execute('start "" "' .. path .. '"') end
with SWS project startup action
mpl is offline   Reply With Quote
Old 10-16-2017, 04:32 PM   #3
Commala
Human being with feelings
 
Join Date: Feb 2014
Posts: 615
Default

Thank you MPL, it works! My only concern is that I have to code the project name in the script, which works fine if I'm only opening a general template. However, if I have a separate Reason project associated with each Reaper project, this then requires loading an instance of this script for each project in order to link it to the respective Reason project. Those script instances would build up quickly and then require their own file folder structure to be maintained in order to organize them.

Is it possible to have a single instance of the script work using a wildcard method, whereby when a saved Reaper project is loaded, the script will look in the specified Reason project file folder for the matching *.reason file? I always save the Reaper and Reason project files to share the same filename
Commala is offline   Reply With Quote
Old 10-16-2017, 08:58 PM   #4
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

and same folder? Give example of reaper and reason project paths for one project.
mpl is offline   Reply With Quote
Old 10-17-2017, 04:34 PM   #5
Commala
Human being with feelings
 
Join Date: Feb 2014
Posts: 615
Default

Different folder paths

Reason project path is C:/Users/username/Documents/Reason/Song/Reaper Rewire/projectname.reason

Reaper project path is C:/Users/username/Documents/Reaper/Projects/projectname.rpp

Not sure if it would need to remember the Reaper project folder, or whether it would be sufficient just to check the Reason project folder for a .reason file with the same title as the active Reaper project?
Commala is offline   Reply With Quote
Old 10-18-2017, 06:53 AM   #6
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

Code:
path = 'C:/Users/username/Documents/Reason/Song/Reaper Rewire/'
retval, projfn = reaper.EnumProjects( -1, '' )
if projfn:lower():find('.rpp') then
  projfn = projfn:reverse():match('(.-)[%/\\]'):reverse():gsub('.RPP','')
  filename = path..projfn..'.reason'
  if reaper.GetOS():find("OSX") then os.execute('open "" "' .. filename .. '"') else os.execute('start "" "' .. filename .. '"') end
end
mpl is offline   Reply With Quote
Old 10-18-2017, 08:53 PM   #7
Commala
Human being with feelings
 
Join Date: Feb 2014
Posts: 615
Default

YES!

I changed the fourth line where it says .RPP to lowercase, and it works perfectly! Thank you so much for this MPL, now Reason is that much closer to behaving like a integrated part of my Reaper project.

This means alot to me, and to show my appreciation I'm going to make a donation!
Commala is offline   Reply With Quote
Old 10-20-2017, 07:13 AM   #8
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

Thank you very much!

I don`t know why, but mostly my rpp are uppercase so in case you want to disrespect (right word?) case, you can use something like

projfn = projfn:reverse():match('(.-)[%/\\]'):reverse():gsub('.RPP',''):gsub('.rpp','')
mpl 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 07:43 PM.


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