<?xml version="1.0" encoding="UTF-8"?>
<rename_preset case="none" group="转换" ignoreext="yes" script="yes" type="normal" version="13">
	<from>*</from>
	<to>*</to>
	<script>@script JScript
// 阿拉伯数字转中文数字-无单位
// 作者：@Chaoses-Ib
// 版本：220626.2
// 仓库：https://github.com/Chaoses-Ib/IbDOpusScripts
// 从命令进行调用：
// Rename PRESET=&quot;阿拉伯数字转中文数字-无单位&quot; SCRIPTARG onlyFirstNumber:true upperCase:false
function OnGetCustomFields(getFieldData)
{
    getFieldData.fields.onlyFirstNumber = true
    getFieldData.field_labels(&apos;onlyFirstNumber&apos;) = &apos;只转换第一段数字&apos;
    getFieldData.fields.upperCase = false
    getFieldData.field_labels(&apos;upperCase&apos;) = &apos;大写中文数字&apos;
}
function OnGetNewName(getNewNameData)
{
    var regex = getNewNameData.custom.onlyFirstNumber ? /[0-9]+/ : /[0-9]+/g
    var numTable = getNewNameData.custom.upperCase ? &apos;零壹贰叁肆伍陆柒捌玖&apos; : &apos;零一二三四五六七八九&apos;
    return getNewNameData.newname_stem_m.replace(regex, function(number){
        return number.replace(/[0-9]/g, function(digit){ return numTable[digit] })
    }) + getNewNameData.newname_ext_m
}</script>
</rename_preset>
