Skip to content

Instantly share code, notes, and snippets.

@moluapple
moluapple / ScreenMoving.js
Created June 21, 2011 09:21
Funny Time!
/**********************************
* 提示、警告框,模拟切入淡出效果
* for Adobe Illustrator, Indesign
**********************************/
#targetengine 'session';
var
i = 0,
s = $.screens[0].toString().split ('-')[1].split(':'),
len = s[0]/10,
y = s[1]/2 - 158,
@moluapple
moluapple / timeToSave.jsx
Created June 22, 2011 03:35
Popup Image Notifier
/***************************
* 作为bridge启动脚本使用
* 每15分钟弹出图片提示保存文件
* 点击图片使弹窗关闭
* 测试环境: AI CS5 Win7
* ImageURL: http://cdn1.iconfinder.com/data/icons/pry_hardware/512/Time_Machine.png
***************************/
#target bridge
var time = 15; //时间设定,分钟
@moluapple
moluapple / changeSysTime.jsx
Created June 23, 2011 09:47
Change System Time
/***************************
* 修改Windows系统时间
* 用于运行超过时限无法运行的js
***************************/
var d = new Date();
var today ='date ' + [d.getFullYear(), d.getMonth()+1, d.getDate()].join('-');
function changeDate(date, del){
var filerf = new File ('setDate.bat');
var flag = filerf.open ('w');
@moluapple
moluapple / openInIDByVer.jsx
Created June 23, 2011 14:37
Open Indd file with Creator app
/***********************************
* 作为bridge启动脚本使用
* 选中Indd文件右键菜单调用
* 可检测CS2-CS5.5版本Indd文件
* 若系统安装了相应版本程序,则用其打开
* 否则用最新版程序打开
***********************************/
#target bridge
@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 / 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;
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: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]]
}
});
@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: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,