2016-03-10 98 views
0

再現菜單的命令序列我有一個排版(CC2015)DOC這樣的: n pairs of ovals and polygonsIndesign。如何通過腳本

手動,我可以得到n條路徑白衣此菜單命令序列:

  1. 選擇所有
  2. OBJECT - > PATHFINDER - >添加
  3. 推出化合物路徑

the result

如何通過腳本得到同樣的結果[AppleScript的或Javascript]

+0

...只有很少的嘗試;我不是開發者。 – Paolo

回答

1

我編寫了一段代碼,你似乎做你找什麼?

tell application "Adobe InDesign CC 2015" 
     tell document 1 
      set pgs to every page 
      repeat with aPage in pgs 
       set pageItems to every page item of aPage 
       set previousItem to "" 
       if pageItems is not equal to {} then 
        repeat with anItem in pageItems 
         if previousItem = "" then 
          set previousItem to anItem 
          set finalItem to "" 
         else 
          set workingItem to previousItem 
          set previousItem to anItem 
          set finalItem to add path workingItem with anItem 
         end if 
        end repeat 
        if finalItem is not equal to "" then 
         set theResult to release compound path finalItem 
        end if 
       end if 
      end repeat 
     end tell 
    end tell 
+0

謝謝!這正是我所期待的。 – Paolo

+0

另一個問題:我怎樣才能迭代這個流程,爲每一頁文檔1逐頁? – Paolo

+0

將'set pgs添加到每個頁面'然後重複循環。完整的例子...'告訴應用程序 「Adobe InDesign中CC 2015」 \t告訴文檔1 \t \t組PGS到每一頁PGS \t \t \t集pageItems \t \t重複與APAGE到APAGE \t \t的每一頁項\t \t \t \t集previousItem爲 「」 \t \t \t重複與anItem在pageItems \t \t \t \t如果previousItem = 「」 然後 \t \t \t \t \t集previousItem到anItem \t \t \t \t其他 \t \t \t \t \t集workingItem到previousItem \t \t \t \t \t集previousItem到anItem \t \t \t \t \t集finalItem添加路徑workingItem與anItem \t \t \t \t結束時,如果 \t \t \t年底重複 \t \t \t集theResult釋放複合路徑finalItem \t \t年底重複 \t年底告訴 結束tell' – ThrowBackDewd