2014-11-18 5 views
0

InDesign CS 5.5에서 문서 사전을 삭제하는 데 문제가 있습니다.InDesign : 문서 사전 삭제

var myUserDictionaries = app.userDictionaries; 
var myCountDict = myUserDictionaries.count(); 

for (var i = myCountDict-1; i >= 0; i--) { 
    myUserDictionary = myUserDictionaries[i]; 
    var myAddedWords = myUserDictionary.addedWords; 
    myUserDictionary.removeWord(myAddedWords); 
} 

을하지만이 훼손되지 않은 문서 사전 잎 :

InDesign Document Dictionary

나는이 스크립트를 사용하여 사용자 사전의 내용을 지울 수 있습니다. 몇 년 전,이 as seen on the Adobe forums.

해결되지 않은 문제가 있었다 그러나 나는이 코드 (from here) 발견 :

var myHyphenations = app.activeDocument.hyphenationExceptions; 
for (var i = 0; i < myHyphenations.length; i++) { 
    if (myHyphenations[i].name === "Danish") { 
     var mySourceDictionary = myHyphenations[i]; 
     mySourceHyphenations = mySourceDictionary.addedExceptions; 
     break 
     } 
    } 

문서 사전에 액세스 할 수 있도록 보인다. 하지만 내 질문은 (내가 프로그래머가 아니기 때문에),이 코드를 수정하여 문서 사전을 지우거나 삭제하는 방법 (영어 : 미국의 경우)입니까?

답변

0

실제로 이것은 예상했던 것보다 간단합니다.

var myHyphenations = app.activeDocument.hyphenationExceptions; 
var myCountDict = myHyphenations.count(); 
for (var i = myCountDict-1; i >= 0; i--) { 
    myHyphenation = myHyphenations[i]; 
    var myAddedWords = myHyphenation.addedExceptions; 
    myHyphenation.removeException(myAddedWords); 
    } 
: 여기

은/삭제 문서 사전을 지 웁니다 스크립트의