Skip to content

Instantly share code, notes, and snippets.

View milligramme's full-sized avatar

milligramme milligramme

View GitHub Profile
#!/usr/bin/env bash
locale=ja_JP
version=`ls $HOME/Library/Caches/Adobe\ InDesign/ | cut -d\ -f2`
for i in $version
do
echo $i
rm -v $HOME/Library/Caches/Adobe\ InDesign/Version\ $i/$locale/InDesign\ Recovery/*
done
exit 0
#target "indesign"
var dismiss_grids = function () {
var doc = app.documents[0];
var grid_pref = doc.gridPreferences;
var cjk_grid_pref = doc.cjkGridPreferences;
grid_pref.baselineGridShown = false;
grid_pref.documentGridShown = false;
cjk_grid_pref.showAllFrameGrids = false;
@milligramme
milligramme / README.md
Last active March 24, 2018 15:43
export idml from indd and then convert idml to indd

InDesign 7.5 to 7.0 downconverting

exec export_idml.jsx

it will export idmls into idml folder

exec idml_to_indd_with_name.jsx

# -*- coding: utf-8 -*-
require "spreadsheet"
xls = Spreadsheet::Workbook.new
sheet = xls.create_worksheet :name => "spreadsheet.gem color sample"
colors = [
:aqua,
:black,
:blue,
:cyan,
#!/usr/bin/env bash
rand=`uuidgen`
tmpfile=`mktemp $TMPDIR/$rand` || exit 1
set -e
trap 'echo NG; trap "rm -fv $tmpfile" EXIT' ERR
dir="$HOME/Library/Application Support/TextMate/Managed/Bundles/Bundle Support.tmbundle/Support/shared/lib/tm"
echo "# -*- coding: utf-8 -*-" > $tmpfile
#target "InDesign"
var duplicate_to_hidden_insertionpoint = function () {
var doc = app.documents.add();
// overset textframe1
var txt_frame1 = doc.textFrames.add({geometricBounds:[0,0,1,1], contents:"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."});
var txt_frame2 = doc.textFrames.add({geometricBounds:[100,0,200,100]});
#include "~/private/scriptui_boilerplate/ui/index.jsx"
#targetengine "aggressive.slider"
var ui = new UI('window');
var win = ui.win;
var val = 28;
var i=0;
ui.add_panel(win, {size:[200,-1], name:'pnl'});
for (var i=0; i < val ; i++) {
(function () {
var doc = app.documents.add();
var c_style = doc.characterStyles.item("cyan").isValid ?
doc.characterStyles.item("cyan") :
doc.characterStyles.add({name:"cyan"});
c_style.fillColor = doc.colors.item('Cyan');
var p_style = doc.paragraphStyles.item("test").isValid ?
doc.paragraphStyles.item("test") :
doc.paragraphStyles.add({name:"test"});
#target "InDesign"
// Create {Paragraph|Character|Table|Cell|Object} Style Pairs
var join_ancestor = function (style, separator, buff) {
if (style.parent.constructor.name === 'Document') {
if (buff === undefined) {
return style.name
}
else {
return buff