Skip to content

Instantly share code, notes, and snippets.

View ryanlfoster's full-sized avatar

Ryan L. Foster ryanlfoster

View GitHub Profile
main();
function main(){
var ph= 200;// page heigt
var pw = 200;// page width
var doc = app.documents.add({/*make a doc*/
documentPreferences:{
pageWidth:pw,
pageHeight:ph
var doc = app.documents.add();
var page = doc.pages.item(0);
var tf = page.textFrames.add({
geometricBounds:[12.7,12.7,100,210],
contents: "Hi God, it's me - Jesus."
});
tf.paragraphs.item(0).pointSize = 42;
tf.fit(FitOptions.FRAME_TO_CONTENT);
osascript -e 'tell application "Adobe InDesign CS5" to do script alias "Users:fabiantheblind:Desktop:test:test.jsx" language javascript '''
/*
extended javascript for
Adobe Indesign 5.5
by
PDXIII
http://about.me/PDXIII
Honestly: It's from fabiantheblind, but I typed it ;-)
*/
/*
extended javascript for
Adobe Indesign 5.5
by
PDXIII
http://about.me/PDXIII
Honestly: It's from fabiantheblind, but I typed it ;-)
*/
//
// 狙った部分をxref要素としてXMLツリーに追加する.
// InDesign CS5
//
// テキストフレームが一つ存在する indd 文書を想定
var doc = app.activeDocument;
var tf = doc.textFrames.firstItem()
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="Service"
targetNamespace="http://localhost:80/Service.wsdl"
xmlns:tns="http://localhost:80/Service.wsdl"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:IDSP="http://ns.adobe.com/InDesign/soap/"
xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
/*
extended javascript for
Adobe Indesign 5.5
by
PDXIII
http://about.me/PDXIII
originally by fabiantheblind
https:github.com/fabiantheblind
*/
(function(){
var docs = app.documents;
if(docs.length===0)return;
for(var i=0,len=docs.length;i<len;i++){
var doc = docs[i];
var docPath = doc.fullName.absoluteURI;
if(parseInt(app.version) > 6){
var idmlFile = new File(docPath.split('.')[0]+'.idml');
doc.exportFile(ExportFormat.INDESIGN_MARKUP,idmlFile);
}else{
%w(sinatra notify).each{|x| require x}
require "sinatra/reloader" if development?
configure do
TITLE = "InDesign Scripting Server"
INDESIGN_VERSION = "CS5"
end
get "/" do
Notify.notify TITLE, "Target Versiion InDesign #{INDESIGN_VERSION}"