Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 01-23-2020, 09:10 AM   #1
SebyMusic
Human being with feelings
 
Join Date: Apr 2018
Posts: 211
Default Create Send 1 from selected track, if Send 1 exist, then just create a send to it

Hi guys, ok, I have that script below that works and create a send from the selected track to SEND 1 if you will. Now, what i<m looking for, is that before the popup question, if SEND 1 is already there and does already exist, then just create a Send to the SEND 1.

I hope I'm clear.
tks
Seby

Code:
function Msg(param)
  reaper.ShowConsoleMsg(tostring(param).. "\n")

end

local defsendvol = ({reaper.BR_Win32_GetPrivateProfileString( 'REAPER', 'defsendvol', '0',  reaper.get_ini_file() )})[2]
local defsendflag = ({reaper.BR_Win32_GetPrivateProfileString( 'REAPER', 'defsendflag', '0',  reaper.get_ini_file() )})[2]



function newSend()
local retval, pref = reaper.GetUserInputs( 'Creat New Aux',1, "Enter the name of the Aux 1:", "")

if retval then 
  for i = 1, reaper.CountSelectedTracks(0) do
  local tr = reaper.GetSelectedTrack(0,i-1)
  if tr then 
    track_col =  reaper.GetTrackColor( tr )
    _, src_name = reaper.GetSetMediaTrackInfo_String( tr, 'P_NAME', '',false )
    reaper.InsertTrackAtIndex( reaper.GetNumTracks(0), true )
    new_dest_tr =  reaper.CSurf_TrackFromID( reaper.GetNumTracks(0), false )
    
    new_send_id = reaper.CreateTrackSend( tr, new_dest_tr)
    if new_send_id >= 0 then
    new_name = 'Aux '..pref..' '
    if new_dest_tr then
      reaper.GetSetMediaTrackInfo_String( new_dest_tr, 'P_NAME', new_name ,true)
      reaper.SetTrackSendInfo_Value( tr, 0, new_send_id, 'D_VOL', defsendvol)
      reaper.SetTrackSendInfo_Value( tr, 0, new_send_id, 'I_SENDMODE', defsendflag)
    end
    end
  end
  end
  reaper.TrackList_AdjustWindows( false )
end
end
SebyMusic is offline   Reply With Quote
Old 01-23-2020, 01:34 PM   #2
SebyMusic
Human being with feelings
 
Join Date: Apr 2018
Posts: 211
Default Hire someone for scripting

Hi, I'm looking for someone I could hire to create a script for reaper for me.
Is there anyone interested please?
tks
Seby
SebyMusic is offline   Reply With Quote
Old 01-23-2020, 02:24 PM   #3
vsthem
Human being with feelings
 
Join Date: Nov 2018
Posts: 654
Default

https://forums.cockos.com/showthread.php?t=200614

Check out send to fx1 . Might be what you're looking for
vsthem is offline   Reply With Quote
Old 01-23-2020, 02:51 PM   #4
SebyMusic
Human being with feelings
 
Join Date: Apr 2018
Posts: 211
Default

Quote:
Originally Posted by vsthem View Post
https://forums.cockos.com/showthread.php?t=200614

Check out send to fx1 . Might be what you're looking for
hi, tks, but I wanted to add the same thing it does but to my actual script.
But you are right, this is exactly what I needed.

tks
Seby
SebyMusic 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 10:06 AM.


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