Old 06-28-2020, 01:18 AM   #1
zookthespook
Human being with feelings
 
Join Date: Mar 2015
Location: India Mumbai
Posts: 816
Default script idea . - Random file replacement .

Hi ,
As my coding abilities are on level "hello world", here is a query/request . Is it possible to do the following via a script and if it is not a crazy code to write if someone would be generous to do the sams ?

1Select multiple items on TCP ( in this case lets assume we select five)
2Run action
3Actions opens up a query to specify an audio
folder
4Now the script randomly selects five files and replaced them randomly in the items we have selected.

if the API allows us to create a function like this it could be a boon to sounf desiging.
zookthespook is offline   Reply With Quote
Old 06-28-2020, 01:33 AM   #2
solger
Human being with feelings
 
solger's Avatar
 
Join Date: Mar 2013
Posts: 5,844
Default

Maybe have a look at the Switch item source Actions/scripts available in SWS Extensions and in ReaPack (Archie-ReaScripts and me2beats Scripts repositories: https://reapack.com/repos).
As example:
  • Xenakios/SWS: Switch item source file to random in folder
  • Switch item source file to random in folder <- me2beats Scripts
__________________
ReaLauncher
solger is offline   Reply With Quote
Old 06-28-2020, 01:47 AM   #3
Archie
Human being with feelings
 
Archie's Avatar
 
Join Date: Oct 2017
Location: Russia
Posts: 366
Default

@zookthespook

__________________
=================================
ReaPack| Archie-ReaScript: Discussion | Donate | Donate2 | Donate3 | PayPal |

Last edited by Archie; 06-28-2020 at 01:53 AM.
Archie is offline   Reply With Quote
Old 06-28-2020, 02:26 AM   #4
zookthespook
Human being with feelings
 
Join Date: Mar 2015
Location: India Mumbai
Posts: 816
Default

Holy smokes !! this is amazing !!
and thank you archie for helping out to setup the custom action .


zook
zookthespook is offline   Reply With Quote
Old 06-28-2020, 08:19 AM   #5
zookthespook
Human being with feelings
 
Join Date: Mar 2015
Location: India Mumbai
Posts: 816
Default

Hi ,
so i made the custom action and it works well, however , i was hoping that there are two things i am missing in this action.

1.Setting a directory path once , instead of the script outputting a query everytime the action is executed. Something like the Rs5k or Reaverbate where once you specify a folder , it allows you to scan thru all the items in the folder unless instructed to change the folder.
For some reason , the script does not remember the last accessed folder.
So for eg the first time i run the script >script requests for the folder and by default it is showing say "G:\xx\yy" and i specify to access the folder "E:\aa\bb"
the next time launch the script it goes back to G:\xx\yy instead of remember E:\aa\bb

2.If it could import with the command use media for selected items(loop\stretch to fit)it would be better in the case scenario i am hoping for.

zook
zookthespook is offline   Reply With Quote
Old 06-28-2020, 05:25 PM   #6
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 1,719
Default

Quote:
Originally Posted by zookthespook View Post
Hi ,
so i made the custom action and it works well, however , i was hoping that there are two things i am missing in this action.

1.Setting a directory path once , instead of the script outputting a query everytime the action is executed. Something like the Rs5k or Reaverbate where once you specify a folder , it allows you to scan thru all the items in the folder unless instructed to change the folder.
For some reason , the script does not remember the last accessed folder.
So for eg the first time i run the script >script requests for the folder and by default it is showing say "G:\xx\yy" and i specify to access the folder "E:\aa\bb"
the next time launch the script it goes back to G:\xx\yy instead of remember E:\aa\bb

2.If it could import with the command use media for selected items(loop\stretch to fit)it would be better in the case scenario i am hoping for.

zook
To get a folder path with a dialog box, try this:

Code:
function Get_Folder_Path() 
  retval, folder = reaper.JS_Dialog_BrowseForFolder( "Select your folder path", Folder_Path  )
  if retval == false then return end
  return folder .. "/"
end

Path = Get_Folder_Path()
__________________
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 06-29-2020, 03:06 AM   #7
zookthespook
Human being with feelings
 
Join Date: Mar 2015
Location: India Mumbai
Posts: 816
Default

Thank you Thonex !
doing that right away

zook
zookthespook 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 05:25 AM.


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