Skip to content

Instantly share code, notes, and snippets.

@moluapple
moluapple / gist:1721220
Created February 2, 2012 03:26
[Indesign] ResizeImage_BT_PS
// 调用PhotoShop按照Indesign中尺寸修改图像大小
Main();
function Main() {
var image = app.selection[0].images[0];
var imagePath = image.itemLink.filePath;
var hScale = image.horizontalScale;
var vScale = image.verticalScale;
CreateBridgeTalkMessage();
@moluapple
moluapple / gist:5690732
Last active December 17, 2015 23:39
Powershell 命令收集
Dir *.png | rename-item -newname { $_.name -replace ".png",".pdg" }
Dir *.pdg | rename-item -newname { "000" + $_.name }
//Batch Incremented File Rename
$files = Get-ChildItem c:\yourpath\*.ext
$id = 1
$files | foreach {
Rename-Item -Path $_.fullname -NewName (($id++).tostring() + $_.extension)
}
@moluapple
moluapple / 空园子.md
Last active December 17, 2015 15:59
《空园子》 杨键

##《空园子》 杨键

我是一座空园子,

我是一条空河流,

我是一座空山,

我是一个空了的妈妈,

@moluapple
moluapple / keepWindowBounds.js
Last active December 15, 2015 03:49
[Indesign] Reset the window bounds to the same as last time (CS6)
#targetengine "keepWindowBounds"
(function() {
app.addEventListener("afterOpen", setBounds);
function setBounds(ev) {
var layoutWin = ev.parent,
bounds = eval('[' + app.extractLabel('bounds') + ']');
layoutWin.addEventListener("beforeClose", insertBounds);
function insertBounds(ev) {
@moluapple
moluapple / Import Multi-Page PDF.jsx
Last active December 12, 2015 13:09
置入多页面PDF (Illustrator CC 2015)
var doc = activeDocument,
f = File.openDialog ('选择文件 ', '*.pdf'),
p = prompt ('置入第 1 到?页', 5, '指定页数')
i = 0;
for (; ++i <= p;) {
app.preferences.setIntegerPreference('plugin/PDFImport/PageNumber', i);
doc.placedItems.add().file = f;
}
app.preferences.setIntegerPreference('plugin/PDFImport/PageNumber', 1);
@moluapple
moluapple / 纸质书籍电子版制作一般流程.md
Last active December 10, 2015 01:48
纸质书籍电子版制作一般流程

##纸质书籍电子版制作一般流程

  1. 扫描
  2. OCR文本识别
  3. 人工校对
  4. 排版(版面大致/精确还原)
  5. 二次校对 ……

我们一般从步骤2开始。

@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 / Description
Created October 23, 2012 15:13 — forked from linktoming/Description
Batch Delete Amazon Kindle Library Items
Credit and Usage: http://www.mobileread.com/forums/showthread.php?t=162972
@moluapple
moluapple / cchere_posts_downloader.py
Created August 26, 2012 14:07
[python2]cchere user posts downloader
#!/usr/bin/python
# -*- coding:utf-8 -*-
""" download all cchere posts of the author from pre-collected postlist
currently the list was collected manually
TODO: get the postlist from cchere user home automatically
NOTE: Fanqiang is needed as the exists of GFW
code based on: https://code.google.com/p/cchere-thread-saver/
"""
@moluapple
moluapple / cooldtpNewPostsChecker.py
Created August 25, 2012 15:14
[Python2]使用 mechanize 登录网站演示
#!/usr/bin/python
# -*- coding:utf-8 -*-
import mechanize
def check_new_posts(username, password):
b = mechanize.Browser()
b._factory.encoding = "utf8"
b.set_handle_robots(False)
b.addheaders = [('User-Agent','Mozilla/4.0(compatible; MSIE 6.0; Windows 98;)')]