如何将ExtendScript对象存储在关联数组中?
var assArray = {};
for (i=1; i<=app.project.items.length; i++) {
//alert(app.project.item(i).name); one of them is "_vegs"
assArray[app.project.item(i).name] = app.project.item(i);
}
alert(assArray["_vegs"].name);
此代码在第二个警报行返回错误。
Unable to execute script at line 9. undefined is not an object.
我在这里缺少什么?
答案 0 :(得分:0)
var assArray = {};
for (i=1; i<=app.project.items.length; i++) {
//alert(app.project.item(i).name); one of them is "_vegs"
assArray[app.project.item[i].name] = app.project.item[i];
}
alert(assArray["_vegs"].name);
我认为问题在于(i)希望[i]能够发挥作用