2015-08-13 40 views
2

這裏是一個非常簡單的腳本,覆蓋第1頁上的所有主頁項目:InDesign Applescript:「覆蓋主頁面項目」故障?

tell application id "com.adobe.InDesign" 
    tell active document 
     override every item of master page items of page 1 destination page page 1 
    end tell 
end tell 

出於某種原因,這導致頁面項目上移,併到其原始位置的左側。我無法弄清楚爲什麼會發生這種情況。覆蓋頁面項目不應移動項目。事實上,當我在InDesign中手動覆蓋時,沒有任何變化。它似乎正在影響特定的佈局。當我做測試文檔時,問題就會消失。這個特定的文檔有很多級別的主頁面彼此適用,然後應用於佈局。

其他人遇到此問題?

+0

請參閱[Adobe的這種長時間的討論論壇](https://forums.adobe.com/message/6315798)(葡萄酒吐司間歇)。不幸的是,雖然該線程做了很多探索並提供了一個解決方案,但它會在下一頁結束時提示「它似乎不適用於CC」。所以顯然你使用的確切版本是重要的。儘管如此,你可能會找到一個探索和實驗的基地。 – usr2564301

+0

我在某些佈局中看到了同樣的問題。不知道爲什麼會發生... – user1754036

回答

0

這在這裏cc2014工作對我來說https://forums.adobe.com/message/4294636#4294636

function main() { 
    var doc = app.activeDocument, 
     i, l, page, j, k; 

    for (i = 0, l = doc.pages.length; i < l; i++) { 
     page = doc.pages[i]; 
     if (page.appliedMaster !== null) { 
      for (j = 0, k = page.appliedMaster.pageItems.length; j < k; j++) { 
       try { 
        page.appliedMaster.pageItems[j].override(page); 
       } catch(e) {} 
      } 
     } 
     page.pageItems.everyItem().detach();  
    } 
} 

if (app.documents.length > 0) { 
    app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Detach Master Page Items"); 
} 
0

這CC 2018(13.0.1)和塞拉利昂10.12.6爲我工作:

tell application id "com.adobe.indesign" 
    tell document 1 
     repeat with i from 1 to count of pages 
      try 
       override (every item of master page items of page i whose allow overrides is true) destination page page i 
      on error 
       -- 
      end try 
     end repeat 
    end tell 
end tell