我正在尝试重写Indesign CS5.5中的CornerEffects.jsx脚本,使其在学校更加用户友好,因此人们确切知道第一点的位置以及最后一点的位置等。脚本必须工作在CS3中也是如此。 我需要选项才能在矩形是选定对象时更改,否则回退到默认值。我尝试过以下代码片段,但它无论如何都会回到默认状态。谢谢,伙计们。
function myDisplayDialog(myObjectList){
if (app.selection.constructor.name == "Rectangle"){
var myStringList = ["all points","first point (top-left)", "last point(top-right)", "second point(bottom-left)", "third point(bottom-right)", "fourth point(top-right)", "first two", "second and third", "last two", "first and last", "odd points", "even points"]
}
else{
var myStringList = ["all points","first point", "last point", "second point", "third point", "fourth point", "first two", "second and third", "last two", "first and last", "odd points", "even points"]
}
答案 0 :(得分:0)
只要看一下,你通常会使用'selection [0] .constructor'而不是'selection.constructor',但是很难说它是否适用于此修复程序。您应该能够遍历ExtendScript Toolkit中的代码,以查看它出错的地方。将其分解为能够更容易地看到值的步骤可能会有所帮助。
出于好奇,学校正在教授InDesign脚本?