Skip to content

Instantly share code, notes, and snippets.

@moluapple
moluapple / gist:1134174
Created August 9, 2011 14:24
[Indesign] Fill Blank Cells
var oCells = app.documents[0].stories.everyItem().tables.everyItem().cells.everyItem().getElements(),
len = oCells.length,
i = 0;
for (; i < len; i ++){
oCells[i].contents == "" && oCells[i].contents = "-";
}
@moluapple
moluapple / gist:1133311
Created August 9, 2011 03:04
[Indesign] Table Stroke Fixer
var oTable = app.selection[0].parent.parent,
oRows = oTable.rows,
i = 0,
len = oRows.length;
for (; i < len; i++) {
oRows[i].cells[0].insertionPoints[0].endBaseline < oRows[i - 1].cells[0].insertionPoints[0].endBaseline
&& oRows[i - 1].rowSpan < 2
&& (oRows[i - 1].bottomEdgeStrokeWeight = oRows[i].topEdgeStrokeWeight = oRows[0].topEdgeStrokeWeight);
}
! /true/.test(String(app.activeDocument.stories.everyItem().overflows)) && app.activeDocument.stories.everyItem().createOutlines();
@moluapple
moluapple / gist:1117907
Created August 1, 2011 10:27
[Illustrator, Scriptographer] GradientObj Bleeder
/********************************
* Illustrator 中为渐变对象创建出血
* 本脚本在 Scriptographer 环境运行
*******************************/
script.coordinateSystem = "bottom-up";
function bleedMe() {
var a = document.selectedItems[0],
b = a.clone(),
c = elements.itemBleed.value,
@moluapple
moluapple / gist:1096912
Created July 21, 2011 10:14
InDesign CS5 Templates(from indesignsecrets.com)
License Agreement (http://indesignsecrets.com/doc/AdobeTemplatesExhibitB.pdf)
http://publishing-secrets.com/templates/ZIPs/Book1.indt.zip
http://publishing-secrets.com/templates/ZIPs/Book2.indt.zip
http://publishing-secrets.com/templates/ZIPs/Photobook 1.indt.zip
http://publishing-secrets.com/templates/ZIPs/Photobook 2.indt.zip
http://publishing-secrets.com/templates/ZIPs/Recipe Book.indt.zip
http://publishing-secrets.com/templates/ZIPs/Brochure1.indt.zip
http://publishing-secrets.com/templates/ZIPs/Brochure2.indt.zip
http://publishing-secrets.com/templates/ZIPs/Brochure3.indt.zip
@moluapple
moluapple / gist:1091740
Created July 19, 2011 08:43
Extend width of TextFrames with the same geometricBounds
#include "doEx.jsx"
var s = app.selection[0].geometricBounds.toString().replace(/\.\d+/g, '');
doEx('textFrames').each(function () {
if (this.geometricBounds.toString().replace(/\.\d+/g, '') == s) {
this.geometricBounds = [
this.geometricBounds[0], this.geometricBounds[1] - 50, this.geometricBounds[2], this.geometricBounds[3]]
}
});
function FindProxyForURL(url, host) {
// If URL has no dots in host name, send traffic direct.
if (isPlainHostName(host))
return "DIRECT";
// If specific URL needs to bypass proxy, send traffic direct.
if (shExpMatch(url,"activate.adobe.com") ||
shExpMatch(url,"*dropbox.com") ||
shExpMatch(url,"*alcohol-soft.com") ||
@moluapple
moluapple / gist:1083929
Created July 15, 2011 02:36
DatasetsMagic_ScriptUI
//#include 'doEx.jsx'
#target illustrator
#targetengine 'main'
/* doEx.jsx:jQuery風にドキュメントのオブジェクトを抽出するかも
* Copyright 2010 kamiseto. All Rights Reserved.
* ScriptClip http://556.sub.jp/scriptclip/
* なにする? DTP + WEB http://d.hatena.ne.jp/kamiseto/
*/
var myDialogMaker;
@moluapple
moluapple / gist:1069865
Created July 7, 2011 16:11
Datasets Magic
#target illustrator
#targetengine com.adobe.illustrator.demo.flashplayer
try {
var swfFolder = File($.fileName).parent;
} catch (e) {
var swfFolder = File(e.fileName).parent;
}
if (swfFolder != null) {
// Create a resource to describe the ScriptUI window.
var res = "palette { \
@moluapple
moluapple / openInIDByVer.jsx
Created June 23, 2011 14:37
Open Indd file with Creator app
/***********************************
* 作为bridge启动脚本使用
* 选中Indd文件右键菜单调用
* 可检测CS2-CS5.5版本Indd文件
* 若系统安装了相应版本程序,则用其打开
* 否则用最新版程序打开
***********************************/
#target bridge