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 str = 'Hello, Gist!'; | |
alert (str); |
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
class Test { | |
URL url = this.getClass().getProtectionDomain().getCodeSource().getLocation() | |
} | |
def ts = new Test() | |
println ts.url |
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
@Grab(group='org.apache.ant', module='ant-parent', version='1.7.1') | |
def dirPath=args[0] | |
def File dir = new File(dirPath) | |
def ant = new AntBuilder() | |
ant.mkdir(dir:dirPath+'/Fonts') | |
dir.eachDirRecurse { | |
if('Fonts'==it.name){ | |
it.eachFileRecurse { |
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
/* | |
fitimage_ind.jsx | |
画像の幅と高さを取るサンプル | |
画像をフィットさせるサンプル | |
※ピクセルサイズを取るのはInDesignでは無理 | |
*/ | |
//画像の入ったフレームを選択 | |
var sel=app.activeDocument.selection[0]; | |
//中の画像 |
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
(function(){ | |
var sels=app.activeDocument.selection; | |
var startFrame; | |
//テキストフレーム以外を除外 | |
for(var i=sels.length-1;i>-1;i--){ | |
if(sels[i].constructor.name!=='TextFrame'){ | |
sels.splice(i,1); | |
}else{ | |
sels[i].nextTextFrame=NothingEnum.NOTHING; | |
} |
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 basedOnEnum=(function(){ | |
//ExtendScript Toolkitのヘルプファイルへのパス。InDesignCS3、Macの場合 | |
var xmlPath="~/Library/Preferences/ExtendScript Toolkit/2.0/omv$indesign-5.0-ja_jp.xml"; | |
var openFile=new File(xmlPath); | |
if(!openFile.open ("r")) return undefined; | |
var src=openFile.read(); | |
var myXml = new XML(src); | |
var node=myXml.xpath("/dictionary/map/topicref[@navtitle=\"Enum Suite\"]/topicref[@navtitle]"); | |
//$.writeln(node); |
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" | |
(function(){ | |
//ドキュメントが開いていなければ抜ける | |
if(app.documents.length==0) return; | |
//開いているドキュメントを指定 | |
var doc=app.activeDocument; | |
//選択項目がなければ抜ける | |
if(doc.selection.length==0) return; | |
//選択項目のひとつめを指定 |
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" | |
(function(){ | |
//なにも開いてなければ抜ける | |
if(!app.activeDocument) return; | |
var page=app.activeWindow.activePage; | |
//ガイドが4本以下なら抜ける | |
if(page.guides.length<4) return; | |
//ガイドの位置を収集する。 | |
var wLocate=[]; |
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
/** | |
* @fileOverview 開いているInDesignドキュメントを順番にPDFX/1aで保存して閉じます。<br> | |
* <b>使い方</b>:<br> | |
* (1)InDesignドキュメントを複数開き(必ず保存して下さい)スクリプトを実行します。<br> | |
* (2).inddファイルと同階層にPDFを保存し、閉じます。<br> | |
* (3)開いているファイルがすべて閉じたら、「pdfを書き出しました」というアラートが表示されます。<br> | |
* | |
* @author Kanemu | |
* @version 0.1 | |
*/ |
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
/** | |
* @fileOverview 合成文字を作成するスクリプトです。<br> | |
* <b>使い方</b>:InDesignに打ち込んだ文字(「○株」等)を2文字選択し、スクリプトを実行して下さい。 | |
* | |
* @author Kanemu | |
* @version 0.2 | |
*/ | |
#target "InDesign" | |
/** |
OlderNewer