- Script Code -
dofile(reaper.AZ_GetLuaInitPath())
require("reaper_AZSTOKE_SILVER")
retval,inputList = reaper.AZ_GetUserInputList("insertMedia",1,"path:","D:/")
if retval then
filePathList = reaper.AZ_GetFilePathList(inputList[1],"wav")
addPath = reaper.AZ_SetProjectPathFolder("AZSTOKE",3)
beforePath,afterPath = reaper.AZ_SetProjectInfoRecAddPath(0,addPath)
startPos = 0
for i, value in pairs(filePathList) do
item = reaper.AZ_InsertMediaTrackIdSecond(0,1,filePathList[i],0,startPos)
endTime = reaper.AZ_GetMediaItemEndTime(item)
startPos = endTime + 1
end
reaper.AZ_SetProjectInfoRecPath(0,beforePath)
end
- Warm Up -
Prepare the media to be inserted
- Script Detail -
dofile(reaper.AZ_GetLuaInitPath())
require("reaper_AZSTOKE_SILVER")
・Enable the Silver API
retval,inputList = reaper.AZ_GetUserInputList("insertMedia",1,"path:","D:/")
・Enter the text input dialog into inputList with UserInput
if retval then
・When OK is pressed in the text box, run the following
filePathList = reaper.AZ_GetFilePathList(inputList[1],"wav")
・Output the files contained in the entered path info
reaper.AZ_SetProjectPathFolder("AZSTOKE",3)
・Create a dedicated folder in the project's recording folder, appending the current time to the folder name
beforePath,afterPath = reaper.AZ_SetProjectInfoRecAddPath(0,addPath)
・Set the created folder as the project's recording folder
startPos = 0
・Set the start position to 0
for i, value in pairs(filePathList) do
・Loop over the file paths
item = reaper.AZ_InsertMediaTrackIdSecond(0,1,filePathList[i],0,startPos)
・Insert media at the specified track ID and specified seconds
endTime = reaper.AZ_GetMediaItemEndTime(item)
・Output the end time of the inserted media and save it to endTime
startPos = endTime + 1
・Add 1 second to the end time and set it to StartPos
end
reaper.AZ_SetProjectInfoRecPath(0,beforePath)
・Handle reverting the project's recording folder setting
end
- API LINK -
- API LINK -
File/Folder
AZSTOKE_InsertMediaOrinalFolderCreate
Folder Creation Part 1 - Creating a dedicated folder for media inserts














