top of page

AZSTOKE/ALGAZODIK

GameAudio & Art

File/Folder

1

Save data construction Part 1 - Exporting and importing text files -

RANK

SNS SHARE

AZSTOKE_TextFileWirteRead

import sys

sys.path.append(RPR_GetResourcePath() + r"\UserPlugins")

from AZSTOKE_SILVER_python import *


def Msg(parm):

    RPR_ShowConsoleMsg(str(parm) + "\n")


fileName = "saveDate.txt"

_,_,_,folderPath,_,addPath,_ = AZ_SetResoucePathFolder("AZSTOKE",0,"",1024,"",1024)

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


if retval :

    saveText = ""

    for i, value in enumerate(inputList, 1):

        if i == 1:

            saveText = value

        else:

            saveText = saveText + "," + value


    AZ_WriteFile(folderPath,fileName,saveText,0)

    _,_,_,saveText,_ = AZ_ReadFile(folderPath,fileName,"",1024)

    

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

    

    for i, value in enumerate(splitList, 0):

        Msg(splitList[i])

import sys

sys.path.append(RPR_GetResourcePath() + r"\UserPlugins")

from AZSTOKE_SILVER_python import *


・Loading SilverAPI


def Msg(parm):

RPR_ShowConsoleMsg(str(parm) + "\n")


・Debug console output


fileName = "saveDate.txt"


・Substitute the file name including the extension for fileName


_,_,_,folderPath,_,addPath,_ = AZ_SetResoucePathFolder("AZSTOKE",0,"",1024,"",1024)


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


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


- Prepare an input text box, enter the information in the save data, and assign it to the inputList


if retval :


・Detect when Ok is pressed in UserInput and execute the following


saveText = ""


・Prepare string variables to be compiled into a text file


for i, value in enumerate(inputList, 1):


- Loop through the inputList


if i == 1:

saveText = value


・Only the first time, assign the value to saveText as is


else:

saveText = saveText + "," + value


・From the second time onwards, add the value by inserting the delimiter ",".



AZ_WriteFile(folderPath,fileName,saveText,0)


-Create fileName(saveDate.txt) in the resource folder and enter the saveText string


_,_,_,saveText,_ = AZ_ReadFile(folderPath,fileName,"",1024)


・Read the generated file saveDate.txt and assign it to saveText

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


・Create an array based on the delimiter "," in saveText and assign it to splitList

for i, value in enumerate(splitList, 0):


・For loop for each splitList


Msg(splitList[i])


・Output the contents of splitList to the console

APIの利用にはBRONZEに

加入し専用APIを

ダウンロード

する必要があります。

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

PYTHON

AZ_SetResoucePathFolder

AZ_GetUserInputList

AZ_WriteFile

AZ_ReadFile

AZ_GetStringSplitList

​ReaScript File Download 👇

​※実行するには専用APIが必要です

- Script Image -
bottom of page