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 doc = app.documents.add(); | |
var rect = doc.rectangles.add({fillColor:"Cyan", geometricBounds:[0,0,100,100]}); | |
rect.ovals.add(); | |
$.writeln(rect.pageItems.length == 1); | |
rect.ovals.add(); | |
rect.ovals.add(); | |
rect.ovals.add(); | |
rect.ovals.add(); |
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 update_toc = function (doc, opt) { | |
var story_len = doc.stories.length; | |
var _story, _toc_tfs; | |
var toc_styles = doc.tocStyles; | |
for (var i=0, len=toc_styles.length; i < len ; i++) { | |
_story = doc.createTOC(toc_styles[i], true); |
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
float x = 0; | |
float y = 0; | |
float speed = 3; | |
float ran =0; | |
int rect_w = 10; | |
int rect_h = 120; | |
void setup() { | |
size(screen.width, screen.height); | |
x = screen.width *.5; |
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
float rx,ry = 0; | |
void setup() { | |
size(screen.width, screen.height, P3D); | |
colorMode(HSB,360,100,100); | |
smooth(); | |
frameRate(30); | |
} | |
void draw() { | |
background(360*mouseX/width,80,100*mouseY/height); |
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
int r = 124; | |
float sx, sy; | |
void setup() { | |
size(screen.width, screen.height); | |
frameRate(90); | |
} | |
void draw() { | |
//background(255); | |
stroke(7); |
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 used_charstyle_ids_in_nestedstyle = function (parastyles) { | |
var ret = []; | |
for (var i=0, len=parastyles.length; i < len ; i++) { | |
var used_c_style_ids = []; | |
var p_style = parastyles[i]; | |
var ng_styles = p_style.nestedGrepStyles; | |
var nl_styles = p_style.nestedLineStyles; | |
var n_styles = p_style.nestedStyles; |
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" | |
/* | |
NestedGrepStyleの GrepExpressionの構文エラーをさがす | |
InDesignでは構文チェックとかしてくれない | |
RegExpオブジェクトの生成をこころみてチェック | |
*/ | |
var nested_grep_styles_expression_check = function (doc) { | |
var all_para_styles = doc.allParagraphStyles; |
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 "Illustrator" | |
var ai_folder = Folder.selectDialog(); | |
if (ai_folder !== null) { | |
var ai_path = File(ai_folder).getFiles("*.ai"); | |
// これが動作しない | |
// var ai_path = ai_folder.getFiles(function (file) {return /^[^.]+\.ai$/i.test(file.name);}); | |
for (var i=0, len=ai_path.length; i < len ; i++) { |
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" | |
#include "underscore.js" | |
var find_this_link = function (FILENAME) { | |
var doc = app.documents[0]; | |
_.each(doc.links, function (x) { | |
if(x.name == FILENAME) { | |
try { | |
x.parent.select(SelectionOptions.ADD_TO); | |
} |