Created
October 30, 2010 19:03
-
-
Save osima/655633 to your computer and use it in GitHub Desktop.
GroovyからInDesignを実行する
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
| import org.codehaus.groovy.scriptom.* | |
| // | |
| // 引数として渡されたJSファイルのチェック | |
| // | |
| boolean ng=false | |
| if( args.size()<1 ){ ng=true } | |
| else if( new File(args[0]).exists()==false ){ ng=true } | |
| if(ng){ | |
| System.exit(0) | |
| } | |
| // | |
| // ExtendScriptの実行 | |
| // | |
| Scriptom.inApartment | |
| { | |
| def myJS = new File(args[0]).text | |
| int lang = 1246973031 // javascript | |
| //def indapp = new ActiveXObject('InDesign.Application') | |
| //def indapp = new ActiveXObject('InDesign.Application.CS4_J') | |
| def indapp = new ActiveXObject('InDesign.Application.CS3_J') | |
| indapp.doScript(myJS, lang ) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment