top of page
- Script Code -

dofile(reaper.AZ_GetLuaInitPath())

require("reaper_AZSTOKE_SILVER")

require("reaper_AZSTOKE_GOLD") 


p4URL = "********"

p4UserName = "********"

p4Password = "********"

p4Workspace = "********"


function GetP4Files(depotPath, excelPath, sheetName)

    

    filePathList = {}


    if reaper.AZ_P4_Connect(p4URL, p4UserName, p4Password)then

         

         filePathList = reaper.AZ_P4_SyncFiles(p4Workspace, depotPath, -1, "wav")

         

         reaper.AZ_P4_Disconnect()

    end

        

    excelDoc = reaper.AZ_Excel_OpenFile(excelPath)

    

    worksheet = reaper.AZ_Excel_AddWorksheet(excelDoc, sheetName)

 

    row = 1


    reaper.AZ_Excel_SetCellValue_ByNumber(worksheet, row, 1, "Name")

        

    reaper.AZ_Excel_SetCellValue_ByNumber(worksheet, row, 2, "Local Path") 


        

    for i, filePath in pairs(filePathList) do


         row = row + 1


         fileName = reaper.AZ_GetPathInfo(filePath)["FileNameWithoutExtension"]

        

         reaper.AZ_Excel_SetCellValue_ByNumber(worksheet, row, 1, fileName)

        

         reaper.AZ_Excel_SetCellValue_ByNumber(worksheet, row, 2, filePath) 

                

    end


    reaper.AZ_Excel_SaveDocument(excelDoc)

    

    reaper.AZ_Excel_CloseFile(excelDoc)


end


function main()


    retval, inputList = reaper.AZ_GetUserInputList("", 2, "DeptPath,ExcelPath", "")

    

    if retval == false then return end

    

    deptPath = inputList[1]

    excelPath = inputList[2]

    

    sheetName = "voices_" ..os.date("%Y%m%d_%H%M%S", ts)

    

    GetP4Files(deptPath, excelPath, sheetName)

    

end


main()

- Warm Up -

  • Prepare an Excel file

  • Prepare audio files

- Script Detail -

dofile(reaper.AZ_GetLuaInitPath())

require("reaper_AZSTOKE_SILVER")

require("reaper_AZSTOKE_GOLD") 


・Import RIGDOCKS


p4URL = "********"

p4UserName = "********"

p4Password = "********"

p4Workspace = "********"


・Set the Perforce connection info


function GetP4Files(depotPath, excelPath, sheetName)

    

・Define the function to get files from P4 and write them to Excel


    filePathList = {}


・Initialize the file path list


    if reaper.AZ_P4_Connect(p4URL, p4UserName, p4Password)then


・Connect to Perforce

         

         filePathList = reaper.AZ_P4_SyncFiles(p4Workspace, depotPath, -1, "wav")

         

・Sync the WAV files


         reaper.AZ_P4_Disconnect()


・Disconnect from Perforce

    end

        

    excelDoc = reaper.AZ_Excel_OpenFile(excelPath)


・Open the Excel file


    worksheet = reaper.AZ_Excel_AddWorksheet(excelDoc, sheetName)

 

・Add a new worksheet


    row = 1


    reaper.AZ_Excel_SetCellValue_ByNumber(worksheet, row, 1, "Name")

        

    reaper.AZ_Excel_SetCellValue_ByNumber(worksheet, row, 2, "Local Path") 


・Set the header row

        

    for i, filePath in pairs(filePathList) do


・Loop over the file path list


         row = row + 1


         fileName = reaper.AZ_GetPathInfo(filePath)["FileNameWithoutExtension"]

        

・Get the file name without extension


         reaper.AZ_Excel_SetCellValue_ByNumber(worksheet, row, 1, fileName)

 

 

・Write the file name in Excel


         reaper.AZ_Excel_SetCellValue_ByNumber(worksheet, row, 2, filePath) 


・Write the local path in Excel

                

    end


    reaper.AZ_Excel_SaveDocument(excelDoc)


・Save the Excel file

    

    reaper.AZ_Excel_CloseFile(excelDoc)


・Close the Excel file


end


function main()


・Define the main function


    retval, inputList = reaper.AZ_GetUserInputList("", 2, "DeptPath,ExcelPath", "")

    

    if retval == false then return end

    

    deptPath = inputList[1]

    excelPath = inputList[2]

    

・Get user input


    sheetName = "voices_" ..os.date("%Y%m%d_%H%M%S", ts)


・Generate the sheet name

    

    GetP4Files(deptPath, excelPath, sheetName)


・Run the function to get files from P4 and write them to Excel

    

end


main()


・Run the main function

- API LINK -
- API LINK -

Excel

AZSTOKE_Excel_GetP4Files

Record Perforce-managed audio files in Excel and verify whether they are implemented in Wwise (1)

01_BRONZE_ss_edited.png
01_SILVER_edited_edited.png
03_GOLD_edited_edited.png
bottom of page