【问题标题】:Indesign Scripting: If selected object is rectangleIndesign Scripting:如果选定的对象是矩形
【发布时间】:2012-07-15 22:51:45
【问题描述】:

我正在尝试重写 Indesign CS5.5 中的 CornerEffects.jsx 脚本,以使其在学校更加用户友好,因此人们可以准确地知道第一点在哪里以及最后一点在哪里等等。脚本必须工作在 CS3 中也是如此。 仅当矩形是选定对象时才需要更改选项,否则回退到默认值。我尝试了以下 sn-p ,但无论如何它都会退回到默认值。谢谢各位。

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"]
        }

【问题讨论】:

    标签: javascript if-statement rounded-corners adobe-indesign


    【解决方案1】:

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

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

    【讨论】:

    • 我在高中,在 11 年级的网页设计课程中,很多孩子发现整个脚本和角落效果令人困惑..所以我认为这可能会有所帮助..哦,我我在加拿大..
    猜你喜欢
    • 2023-04-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多