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
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
@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
#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
(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
/** | |
* @fileOverview 合成文字を作成するスクリプトです。<br> | |
* <b>使い方</b>:InDesignに打ち込んだ文字(「○株」等)を2文字選択し、スクリプトを実行して下さい。 | |
* | |
* @author Kanemu | |
* @version 0.2 | |
*/ | |
#target "InDesign" | |
/** |
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
import au.com.bytecode.opencsv.* | |
@Grab(group='net.sf.opencsv', module='opencsv', version='2.1') | |
//「ゆうびんホームページ」から落としたcsvを同階層に置く | |
def text = new File('ken_all.csv').getText('MS932') | |
def reader = new CSVReader(new StringReader(text)) | |
def bangoMap = [:] | |
for(;;) { | |
String[] csv=reader.readNext() | |
if(!csv) break |
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
//InDesignの指定のテーブルを表示するサンプル | |
#target "InDesign" | |
var str = prompt('何ページの何番目の表が欲しいんだよ!','1,1'); | |
if(str) { | |
var num = str.split(','); | |
var pageNum = Number(num[0])-1; | |
var tableNum = Number(num[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
#!/bin/sh | |
#new | |
TM_FILEPATH=$1 | |
#スクリプトを複製 | |
#$.write、$.writelnをオーバーライド | |
echo "var file=new File(\"${TM_FILEPATH}.log\");file.encoding=\"UTF8\";file.lineFeed=\"Mac\";file.open('e'); | |
\$.write = function(){file.seek(0,2);file.write(arguments[0])}; | |
\$.writeln = function(){file.seek(0,2);file.writeln(arguments[0])};"> ${TM_FILEPATH}.tmp.jsx | |
#Scriptの内容を書き込み |
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='net.sourceforge.nekohtml', module='nekohtml', version='1.9.14') | |
import org.cyberneko.html.parsers.SAXParser | |
def text=""" | |
<HTML> | |
<table> | |
<body> | |
<tr> | |
<th>サイズ</th> | |
<th>S</th> |
OlderNewer