无法访问字符或段落的 kerningValue 属性
Cannot access kerningValue property of character or paragraph
我正在尝试使用 IDS 的 SOAP API 确定 TextFrame 中字符的字距调整。为了简单起见,我目前仍在尝试只检查第一个字符,它不是任何一种特殊字符(它是一个大写的 T)。我正在使用这个脚本来检查它:
var get_all_textframes = function(document, callback) {
var looper = function(collection) {
for(var i = 0; i < collection.textFrames.count(); i++) {
var textframe = collection.textFrames.item(i);
callback(textframe);
}
};
var recurse = function(group) {
for(var i = 0; i < group.groups.length; ++i) {
looper(group.groups[i]);
recurse(group.groups[i]);
}
};
looper(document);
recurse(document);
};
var document = app.open(File("c:\path\to\idsdoc.indd"));
var output = "\n";
get_all_textframes(document, function(textframe) {
if(textframe.id == 357) {
output += ("Kerning: " + textframe.parentStory.characters[0].kerningValue+ " \n");
}
});
document.close();
result.output = output;
但是,当我 运行 脚本时出现错误 30615: The property is not applicable in the current state
。
如果我尝试从角色中获取任何其他 属性,而不是 kerningValue
,它工作正常。例如,kerningMethod
returns Metrics
.
什么情况导致这个属性不可用,我该如何阅读?
仅当 kerningMethod 设置为 "None" 时才能访问 kerningValue。 属性 是一个字符串,可能因您当地的语言而异。您可以手动将字距调整为 "O" => None 并询问 kerningMethod 以确保正确的名称。
我正在尝试使用 IDS 的 SOAP API 确定 TextFrame 中字符的字距调整。为了简单起见,我目前仍在尝试只检查第一个字符,它不是任何一种特殊字符(它是一个大写的 T)。我正在使用这个脚本来检查它:
var get_all_textframes = function(document, callback) {
var looper = function(collection) {
for(var i = 0; i < collection.textFrames.count(); i++) {
var textframe = collection.textFrames.item(i);
callback(textframe);
}
};
var recurse = function(group) {
for(var i = 0; i < group.groups.length; ++i) {
looper(group.groups[i]);
recurse(group.groups[i]);
}
};
looper(document);
recurse(document);
};
var document = app.open(File("c:\path\to\idsdoc.indd"));
var output = "\n";
get_all_textframes(document, function(textframe) {
if(textframe.id == 357) {
output += ("Kerning: " + textframe.parentStory.characters[0].kerningValue+ " \n");
}
});
document.close();
result.output = output;
但是,当我 运行 脚本时出现错误 30615: The property is not applicable in the current state
。
如果我尝试从角色中获取任何其他 属性,而不是 kerningValue
,它工作正常。例如,kerningMethod
returns Metrics
.
什么情况导致这个属性不可用,我该如何阅读?
仅当 kerningMethod 设置为 "None" 时才能访问 kerningValue。 属性 是一个字符串,可能因您当地的语言而异。您可以手动将字距调整为 "O" => None 并询问 kerningMethod 以确保正确的名称。