0

我正在尝试重写 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"]
        }
4

1 回答 1

0

只看它,您通常会使用 'selection[0].constructor' 而不是 'selection.constructor' 但很难说它是否适用于此修复程序。您应该能够单步调试 ExtendScript Toolkit 中的代码,看看哪里出错了。将其分解为能够更轻松地查看值的步骤可能会有所帮助。

只是出于好奇,哪所学校教授 InDesign 脚本?

于 2011-09-26T07:23:00.860 回答