Last active
April 15, 2023 06:14
-
-
Save monokano/ccdc63fae7b8617c5a0715897f5c874f to your computer and use it in GitHub Desktop.
InDesignドキュメントを保存するときにデフォルトスタイルを [なし] にするJavaScript。startup scripts用
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // inddを保存するときにデフォルトスタイルを [なし] にする | |
| // 選択オブジェクトには影響しない | |
| // 「startup scripts」フォルダに入れる | |
| #targetengine "session" | |
| main(); | |
| function main(){ | |
| app.menuActions.item("$ID/Save").addEventListener("beforeInvoke", setNoStyle, false); | |
| } | |
| function setNoStyle(myEvent){ | |
| var actDoc = app.activeDocument; | |
| //段落 (スタイルなし) | |
| actDoc.textDefaults.appliedParagraphStyle = actDoc.paragraphStyles[0]; | |
| //文字スタイル [なし] | |
| actDoc.textDefaults.appliedCharacterStyle = actDoc.characterStyles[0]; | |
| //オブジェクトスタイル [なし] | |
| actDoc.pageItemDefaults.appliedGraphicObjectStyle = app.allObjectStyles[0]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment