Skip to content

Instantly share code, notes, and snippets.

@nbqx
Created January 15, 2014 02:39
Show Gist options
  • Save nbqx/8429851 to your computer and use it in GitHub Desktop.
Save nbqx/8429851 to your computer and use it in GitHub Desktop.
#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