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
void setup() { | |
size(screen.width, screen.height,P3D); | |
smooth(); | |
frameRate(60); | |
} | |
void draw() { | |
background(2,5,2); | |
translate(150, 240, 100*sin(radians(frameCount%360))); | |
//println(mouseY); |
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 | |
// 合成フォントを含むidmlをひらくと、すでにひらいているinddの同名合成フォント情報まで破壊する | |
app.documents.everyItem().close(SaveOptions.NO) | |
var indd_file = File(Folder.desktop + "/foo.indd") | |
var idml_file = File(Folder.desktop + "/foo.idml") | |
var doc = app.documents.add() | |
doc.save(indd_file) |
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
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT; | |
var img = obj.place(File(file_path)); | |
// set anchor | |
obj.frameFittingOptions.fittingAlignment = AnchorPoint.CENTER_ANCHOR; | |
// fit | |
img[0].fit(FitOptions.CENTER_CONTENT); | |
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL; |
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
tell application "System Events" | |
key code 122 using command down # Cmd-F2 | |
end tell |
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
-- rescue untouchable application frame | |
tell application "Adobe InDesign CC" | |
set rescue_bound to {32, 0, 400, 400} | |
if not use application frame of general preferences then | |
set use application frame of general preferences to true | |
end if | |
if not exists active window then | |
make new document |
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" | |
var sel = app.selection[0]; | |
var ret = find_parent(sel, 'Group'); | |
function find_parent (obj, constructor) { | |
if (obj.parent.parent.constructor.name !== constructor) { | |
return obj.parent | |
} | |
else { | |
return arguments.callee(obj.parent, constructor); |
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
/* | |
フレーム内マージンが設定されたテキストフレーム | |
のアンカーの位置を操作するとマージン分余計に動いてしまう | |
*/ | |
var test = function (doc, opts) { | |
var textframe = doc.textFrames.add({ | |
geometricBounds: opts['frame_bon'] | |
}); | |
// フレーム内マージン!!! |
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" | |
var read_with_guess = function (path, encoding) { | |
var f = File(path); | |
f.encoding = encoding || "cp932"; | |
if (f.open("r")) { | |
var r = f.read(); | |
// TODO regexp pattern | |
if (r.match(/[縲縺繧翫]+/)) { |
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" | |
$.writeln(app.version); | |
var doc = app.documents.add(); | |
app.scriptPreferences.measurementUnit = MeasurementUnits.POINTS; | |
var tf = doc.textFrames.add({geometricBounds:[10,10,50,100]}); | |
var tbl = tf.tables.add({bodyRowCount:4, columnCount:4}); | |
var cr= tbl.rows[0]; | |
r.autoGrow = false; |
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" | |
$.writeln(app.version); | |
var doc = app.documents.add(); | |
app.scriptPreferences.measurementUnit = MeasurementUnits.POINTS; | |
var tf = doc.textFrames.add({geometricBounds:[10,10,50,100]}); | |
var tbl = tf.tables.add({bodyRowCount:4, columnCount:4}); | |
var c = tbl.columns[0]; | |
var i = 4; | |
while (i-=0.0001) { |
NewerOlder