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" | |
// [Extract Metadata with Adobe XMP \[Part 1\] \| IndiSnip \[InDesign® Snippets\]](https://indisnip.wordpress.com/2010/08/13/extract-metadata-with-adobe-xmp/) | |
(function () { | |
var XMPload = Boolean(false); | |
if (ExternalObject.AdobeXMPScript == undefined){ | |
try {ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript'); XMPload = true;} | |
catch(ex) {alert("Unable to load the AdobeXMPScript library!");} | |
} | |
if (!XMPload) { |
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
// Dollar Class | |
$.writeln("build: "+$.build); | |
$.writeln("buildDate: "+$.buildDate); | |
$.writeln("decimalPoint: "+$.decimalPoint); | |
$.writeln("engineName: "+$.engineName); | |
$.writeln("error: "+$.error); | |
$.writeln("fileName: "+$.fileName); | |
$.writeln("flags: "+$.flags); | |
$.writeln("global: "+$.global); |
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 o = [10, 5, 100, 2, 1000, 99]; | |
var o_ = [1121, 7, 22, 111, 1, 33, 23, 3, 919]; | |
var o__ = [1005, 7, 22, 1, 777]; | |
$.writeln( _.min(o) ); //=> 2 | |
$.writeln( _.max(o) ); //=> 99 ???? |
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
/** | |
* Sorting Printer Preset | |
*/ | |
$.localize = true; | |
if (!confirm({ | |
ja:"Alert!\nプリントプリセットを並べ替えをします。\n実行しない場合は「いいえ」", | |
en:"Alert!\nSort order of Printer Presets\nClick \"No\" to cancel" | |
},{noAsDefault:true} )) {exit();}; |
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" | |
// run script without install to ScriptPanel | |
(function(){ | |
var script_path = File.openDialog(); | |
try { | |
script_path ? $.evalFile(script_path) : exit(); | |
} | |
catch(e){ | |
alert(decodeURI(script_path) + "\n" + e); |
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
// ed.onChange = function () { | |
// } | |
// ed.onChaning = function () { | |
// } | |
// ed.onClick = function () { | |
// } | |
// ed.onDoubleClick = function () { | |
// } | |
// ed.onEnterKey = function () { | |
// } |
NewerOlder