2011-09-24 66 views
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"] 
     } 

回答

0

,只要看一眼,你通常會使用「選擇[0] .constructor」而不是「selection.constructor」,但很難說這是否會與此修復程序工作。您應該能夠逐步瀏覽ExtendScript Toolkit中的代碼,以查看它出錯的位置。將它分解成能夠更容易看到值的步驟可能會有所幫助。

只是出於好奇,什麼學校教的InDesign腳本?

+0

我是在高中,並在11級網頁設計過程中,很多孩子覺得整個腳本和角效果的事情confusing..so我想這可能help..oh,我在加拿大。 。 – jackson5