求助帮忙改下脚本面板的文字大小和上下的间缝
var folderPath = "C:\\Users\\Administrator\\Desktop\\对版线\\正常工艺"; // 替换为您要读取的文件夹路径var dlg = new Window("dialog", "正常工艺");
dlg.alignChildren = "left";
var fileList = dlg.add("listbox", , []);
fileList.spacing =60;// 修改 spacing 属性
var fileFolder = new Folder(folderPath);
if (fileFolder.exists) {
var files = fileFolder.getFiles();
for (var i = 0; i < files.length; i++) {
if (files instanceof File) {
fileList.add("item", decodeURI(files.name));
}
}
}
var buttonGroup = dlg.add("group");
var cancelButton = buttonGroup.add("button", , "取消");
var selectButton = buttonGroup.add("button", , "打开");
selectButton.onClick = function () {
var selectedItemIndex = fileList.selection.index;
if (selectedItemIndex < 0) {
alert("请先选择一个文件!");
return;
}
var selectedFile = new File(folderPath + "\\" + encodeURI(fileList.selection.text));
if (!selectedFile.exists) {
alert("所选文件不存在!");
return;
}
app.open(selectedFile);
dlg.close();
}
cancelButton.onClick = function () {
dlg.close();
}
dlg.show();
页:
[1]