gpt4 book ai didi

javascript - 在 Photoshop 脚本中获取操作系统名称

转载 作者:行者123 更新时间:2023-11-29 23:38:26 26 4
gpt4 key购买 nike

好吧,标题说明了一切。

如何在 Photoshop 脚本中获取操作系统的名称?我需要它来确定文件保存路径的语法。

最佳答案

app.systemInformation 属性返回一个字符串,其中包括操作系统和其他系统属性。

你可以这样做:

var infoStrings = app.systemInformation.split('\n');
var os

infoStrings.forEach(function(str) {
if (str.includes('Operating System') {
var osNameIndex = str.indexOf(':') + 2;
os = str.substr(osNameIndex);
}
});

console.log(os) // Should output the name of the current OS

关于javascript - 在 Photoshop 脚本中获取操作系统名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45849467/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com