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
| #target "InDesign-7.0" | |
| var scan_characters = function (obj) { | |
| var ary = []; | |
| var c = obj.characters; | |
| for (var i=0, len=c.length; i < len ; i++) { | |
| if (c[i].contents === '\u0016') { | |
| var cell = c[i].tables[0].cells; | |
| for (var ii=0, llen=cell.length; ii < llen ; ii++) { | |
| ary.push(get_content(cell[ii])); |
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
| #target "indesign" | |
| function boooxed (object_style_name) { | |
| if (app.selection.length !== 1) return | |
| var doc = app.documents[0]; | |
| var sel = doc.selection[0]; | |
| if ('baseline' in sel) { | |
| var bx = sel.insertionPoints[0].textFrames.add(); | |
| bx.appliedObjectStyle = doc.objectStyles.item(object_style_name); | |
| bx.geometricBounds = [0,0,5,30]; | |
| sel.duplicate(LocationOptions.AT_END, bx.parentStory); |
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
| #target "InDesign" | |
| var doc = app.documents[0], fn, fn_string; | |
| fn = function () { alert(new Date().getFullYear() >= 2020 ? "○○○○○" : "◆◆◆◆◆") }; | |
| try { | |
| doc.insertLabel("function", fn); | |
| } | |
| catch(e){ | |
| $.writeln(e); |
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
| #target "InDesign" | |
| var uuid = app.doScript('do shell script "/usr/bin/uuidgen"', ScriptLanguage.applescriptLanguage); | |
| $.writeln(uuid); |
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
| #target "InDesign" | |
| // TORIAEZU package | |
| var package_doc = function(doc) { | |
| var self = this; | |
| var ver = app.version.split('.')[0]; | |
| var pack_f_name = doc.name.replace(/\.indd$/,""); | |
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
| // Object Layer Optionsのメモ | |
| var doc = app.documents[0]; | |
| var rect = doc.rectangles.add({geometricBounds:[0,0,200,200]}); | |
| rect.place(new File("~/Desktop/pasta.ai")); | |
| var g = rect.graphics[0]; | |
| $.writeln("最初のid" + g.id); | |
| var gl = g.graphicLayerOptions.graphicLayers; |
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
| #include "/Users/gdansk/Forks/underscore/underscore.js" | |
| // | |
| var doc = app.documents[0] | |
| var tf = doc.textFrames[0]; | |
| var pic = _.pick(doc.pageItems[0], 'geometricBounds', 'visibleBounds', 'contents'); | |
| $.writeln(pic.toSource()); | |
| var plc = _.pluck(doc.pageItems, 'geometricBounds'); |
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
| // duplication between sytle groups | |
| // pstyle | |
| // - group_a | |
| // - style_a2 | |
| // - style_a1 <src> | |
| // - group_b | |
| // - [style_a1 <dest>] | |
| // | |
| #target 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
| # -*- coding: utf-8 -*- | |
| # show all saved search results | |
| module TwitterOAuth | |
| class Client | |
| def get_saved_search(user) | |
| get("/saved_searches/list.json?screen_name=#{user}") | |
| end | |
| end | |
| end |
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
| module TwitterOAuth | |
| class Client | |
| def get_lists(user) | |
| get("/lists/list.json?screen_name=#{user}") | |
| end | |
| end | |
| end | |
| module Earthquake::Input | |
| def lists |