[powershell] AE中英文切换

最近学了下powershell, 好牛,正好渡狸老师想要一个,所以写了个ae语言切换

如何使用

请先右键左下角win图标

[powershell] AE中英文切换

选择 windows powershell(管理员)

输入以下内容, 并按回车

Invoke-Expression (New-Object Net.WebClient -Property @{ Encoding = [System.Text.Encoding]::UTF8 }).DownloadString('https://tool.yuelili.com/file/ae-change-language.ps1')

然后按照指示选择AE版本,以及要切换的语言按回车即可

[powershell] AE中英文切换

然后再正常运行脚本即可

源码

# Version 1.1
# Author:Yueli
# Description: Change Language of After Effects
# Link: https://www.yuelili.com/?p=22357

# Get After Effects Version
$versions = Get-ChildItem 'HKLM:\SOFTWARE\Adobe\After Effects' |
Select-Object -ExpandProperty Name |
ForEach-Object { $_ -replace 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Adobe\\After Effects\\' }

if ($versions.Count -eq 1) {
    $version = $versions
    Write-Host "Current Selected Version:" $version
}
else {
    # Show Version
    for ($i = 0; $i -lt $versions.Count; $i++) {
        Write-Host ($i + 1).ToString() + "." + $versions[$i]

    }

    # Select Version
    while ($true) {
        $choice = Read-Host "Select After Effects Version"
        if (-not [int]::TryParse($choice, [ref]$null) -or $choice -lt 1 -or $choice -gt $versions.Count) {
            Write-Host "Please Select Correct Version(index)"
        }
        else {
            break
        }
    }

    $version = $versions[$choice - 1]
}

$path = Get-ItemPropertyValue "HKLM:\SOFTWARE\Adobe\After Effects\$version" -Name "InstallPath"

# Lang list
$languages = "zh_CN", "en_US"

for ($i = 0; $i -lt $languages.Count; $i++) {
    Write-Host ($i + 1) $languages[$i]
}

while ($true) {
    $lang_id = Read-Host "Select Language ID"
    if (-not [int]::TryParse($lang_id, [ref]$null) -or $lang_id -lt 1 -or $lang_id -gt $languages.Count) {
        Write-Host "Please Select Correct Version(index)"
    }
    else {
        break
    }
} 

$newLang = $languages[$lang_id - 1]

# Read XML File
$xmlPath = Join-Path $path "AMT\application.xml"
$xml = [xml](Get-Content $xmlPath)

$node = Select-Xml -Xml $xml -XPath "//Data[@key='installedLanguages']"

# Change Language
if ($node) {
    $node.Node.InnerText = $newLang
    $xml.Save($xmlPath)
    Write-Host "Success! Have Changed to" $newLang
}
else {
    Write-Host "Something Error"
}

pause

给TA充电
共{{data.count}}人
人已充电
AEAE文章AE表达式

【AE表达式案例】螺旋线怎么做

2023-3-13 12:57:02

AEAE文章AE表达式

【AE表达式 进阶】自定义函数库 跨合成随意调用

2023-4-21 19:14:27

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
今日签到
搜索