top of page

AZSTOKE/ALGAZODIK

GameAudio & Art

1

File/Folder

AZSTOKE_TextFileWirteRead

Exporting and importing text files

RANK
SNS SHARE

package.cpath = package.cpath .. ";"..reaper.GetResourcePath() .."/UserPlugins/?.dll"

require("reaper_AZSTOKE_SILVER")


function Msg(param)

   reaper.ShowConsoleMsg(tostring(param).."\n")

end


fileName = "saveDate.txt"


_,folderPath,addPath = reaper.AZ_SetResoucePathFolder("AZSTOKE",0)

retval,inputList = AZ_SILVER.AZ_GetUserInputList("Info",3,"Path:,Wav:,Count:","D:/,test,5")


if retval then 

   saveText = ""

   for i, value in pairs(inputList) do

       if i == 1 then

          saveText = value

       else

          saveText = saveText..","..value

       end

   end

   reaper.AZ_WriteFile(folderPath,fileName,saveText,0)

   retval,saveText = reaper.AZ_ReadFile(folderPath,fileName)

   _,splitList = AZ_SILVER.AZ_GetStringSplitList(saveText,",")

   for i, value in pairs(splitList) do

       Msg(splitList[i])

   end

end

package.cpath = package.cpath .. "; "..reaper.GetResourcePath() .."/UserPlugins/?.dll"

require("reaper_AZSTOKE_SILVER")


・Enable use of SilverAPI


function Msg(param)

reaper.ShowConsoleMsg(tostring(param).."\n")

end


- Provides a console output function for debugging


fileName = "saveDate.txt"


- Add the file name and extension and assign the string "saveDate.txt" to fileName


_,folderPath,addPath = reaper.AZ_SetResoucePathFolder("AZSTOKE",0)


・Create a folder called "AZSTOKE" in the resource folder


retval,inputList = AZ_SILVER.AZ_GetUserInputList("Info",3,"Path:,Wav:,Count:","D:/,test,5")


- Set three pieces of input information in UserInput, and assign the input information to inputList after execution.


if retval then


・If GetUserInputList is not canceled


saveText = ""


・Prepare an empty saveText


for i, value in pairs(inputList) do


- Loop playback for inputList


if i == 1 then

saveText = value


・At first, assign the value directly to saveText


else

saveText = saveText..","..value


・From the second time onwards, insert a "," as a separator in saveText and then add the value to the end and assign it.


end

end

reaper.AZ_WriteFile(folderPath,fileName,saveText,0)


- Create a file containing saveText in the specified folder path


retval,saveText = reaper.AZ_ReadFile(folderPath,fileName)


・Read the file you just created and output it to saveText


_,splitList = AZ_SILVER.AZ_GetStringSplitList(saveText,",")


・Change to an array based on the separator of saveText


for i, value in pairs(splitList) do


- Loop playback for each splitList


Msg(splitList[i])


-Console output for each splitList, check if output is done


end

end

To use the API, you need to sign up for a plan.

Download the dedicated API

need to do it.

*SILVER is scheduled to be released in May.

- Script Code -
- Script Image -
- Warm Up -
- Script Detail -
- API -

LUA

​ReaScript File Download 👇

* A dedicated API is required to run this

- Script Image -
bottom of page