Created
January 15, 2014 02:39
-
-
Save nbqx/8429851 to your computer and use it in GitHub Desktop.
This file contains 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
#target InDesign-7.0 | |
function queue(funcs,scope){ | |
(function next(){ | |
if(funcs.length>0){ | |
var f = funcs.shift(); | |
f.apply(scope,[next].concat(Array.prototype.slice.call(arguments,0))); | |
} | |
})(); | |
}; | |
queue([ | |
function(cb){ | |
var doc = app.documents.add(); | |
cb(doc); | |
}, | |
function(cb,doc){ | |
var page = doc.pages[0]; | |
var frame = page.textFrames.add(); | |
cb(frame); | |
}, | |
function(cb,frame){ | |
frame.geometricBounds = [20,20,26,56]; | |
frame.contents = "これはテスト"; | |
cb(frame); | |
}, | |
function(cb,frame){ | |
frame.fit(FitOptions.frameToContent); | |
} | |
],this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment