Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.DS_Store
*.cache
node_modules
*omv$indesign-10.064$10.0*
4 changes: 4 additions & 0 deletions Basiljs/InDesign 5 JavaScript.sublime-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// copy this file to ~/Library/Application Support/Sublime Text 2/Packages/User
{
"cmd": ["osascript", "$packages/Basiljs/run_idscript_5.scpt", "$file"]
}
4 changes: 4 additions & 0 deletions Basiljs/InDesign 5.5 JavaScript.sublime-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// copy this file to ~/Library/Application Support/Sublime Text 2/Packages/User
{
"cmd": ["osascript", "$packages/Basiljs/run_idscript_5.5.scpt", "$file"]
}
4 changes: 4 additions & 0 deletions Basiljs/InDesign 6 JavaScript.sublime-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// copy this file to ~/Library/Application Support/Sublime Text 2/Packages/User
{
"cmd": ["osascript", "$packages/Basiljs/run_idscript_6.0.scpt", "$file"]
}
9 changes: 9 additions & 0 deletions Basiljs/run_idscript_5.5.scpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--usage:
--osascript run.scpt myscript.jsx

on run argv
set aScriptPath to "#include \"" & item 1 of argv & "\""
tell application "Adobe InDesign CS5.5"
do script aScriptPath language javascript
end tell
end run
10 changes: 10 additions & 0 deletions Basiljs/run_idscript_5.scpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--usage:
--osascript run.scpt myscript.jsx

on run argv
set aScriptPath to "#include \"" & item 1 of argv & "\""
tell application "Adobe InDesign CS5"
--display dialog aScriptPath
do script aScriptPath language javascript
end tell
end run
9 changes: 9 additions & 0 deletions Basiljs/run_idscript_6.0.scpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--usage:
--osascript run.scpt myscript.jsx

on run argv
set aScriptPath to "#include \"" & item 1 of argv & "\""
tell application "Adobe InDesign CS6"
do script aScriptPath language javascript
end tell
end run
Binary file removed Comments.tmPreferences.cache
Binary file not shown.
16 changes: 16 additions & 0 deletions ExtendScript.json-tmLanguage

Large diffs are not rendered by default.

5,496 changes: 5,496 additions & 0 deletions ExtendScript.sublime-completions

Large diffs are not rendered by default.

74 changes: 74 additions & 0 deletions ExtendScript.tmLanguage

Large diffs are not rendered by default.

50 changes: 0 additions & 50 deletions ExtendScript.tmlanguage

This file was deleted.

Binary file removed ExtendScript.tmlanguage.cache
Binary file not shown.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ To get all available classes we should take a look into these files:
- /Users/[USERNAME]/Library/Preferences/ExtendScript Toolkit/3.8/omv$indesign-8.0$7.5.xml
- /Users/[USERNAME]/Library/Preferences/ExtendScript Toolkit/3.8/omv$indesign-8.0$8.0.xml

###Todo's

- add auto completion [see this](http://sublime-text-unofficial-documentation.readthedocs.org/en/latest/extensibility/completions.html)

###Misc Links

- if you name your syntax definition only .json It is important to rename the .plist file to .tmlanguage or it wont work. [Info found here](http://stackoverflow.com/questions/15221150/custom-syntax-highlighting-in-sublime-text-2)
Expand Down
21 changes: 21 additions & 0 deletions bin/xml_to_json/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
var fs = require('fs'),
xml2js = require('xml2js');

var parser = new xml2js.Parser();
var fn = 'omv$indesign-10.064$10.0';

fs.readFile('src/' + fn + '.xml', function(err, data) {
parser.parseString(data, function(err, result) {
var json = JSON.stringify(result);
fs.writeFile('src/' + fn + '.json', json, 'utf8', function(err) {
if (err){

return console.log(err);
}else{

console.log('Done');
}

});
});
});
14 changes: 14 additions & 0 deletions bin/xml_to_json/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "xml_to_json",
"version": "1.0.0",
"description": "turn the id xml to json object for furter usage",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"xml2js": "^0.4.5"
}
}
67 changes: 67 additions & 0 deletions bin/xml_to_json/readjson.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Array.prototype.unique = function (){
var r = [];
o:for(var i = 0, n = this.length; i < n; i++){
for(var x = 0, y = r.length; x < y; x++){
if(r[x]==this[i]) continue o;}
r[r.length] = this[i];}
return r;
};
var fs = require('fs');
var fn = 'omv$indesign-10.064$10.0';
var util = require("util");

fs.readFile('src/' + fn + '.json', 'utf8', function(err, data) {
if (err) {
return console.error(err);
} else {
var classes = [];
methods = [];
properties = [];
var json = JSON.parse(data);
// console.log(util.inspect(json.dictionary.package[0].classdef[0], true, 2, true));
var pkg = json.dictionary.package[0];
for (var i = 0; i < pkg.classdef.length; i++) {
var cdef = pkg.classdef[i];
// console.log(cdef.$.name);
classes.push(cdef.$.name);
for (var j = 0; j < cdef.elements.length; j++) {
var ele = cdef.elements[j];
// console.log(util.inspect(ele.method, true, 2, true));
// for(var key in ele.method){
// console.log(key);
// }
// console.log(ele.property[0]);
if (ele.hasOwnProperty('method')) {
// console.log('has method');
for (var l = 0; l < ele.method.length; l++) {
var meth = ele.method[l];
// console.log(meth.$.name);
methods.push(meth.$.name);
}
} else {
// console.log('has not method');
}
for (var k = 0; k < ele.property.length; k++) {
var prop = ele.property[k];
// console.log(prop.$.name);
properties.push(prop.$.name);
}


}

}

var filter = function(elem, pos) {
return this.indexOf(elem) == pos;
};
var uniqueclasses = classes.unique();
var uniquemethods = methods.unique();
var uniqueproperties = properties.unique();

// console.log(uniqueclasses, uniqueproperties, uniquemethods);
fs.writeFile('src/classes.txt',uniqueclasses,'utf8');
fs.writeFile('src/methods.txt',uniquemethods,'utf8');
fs.writeFile('src/properties.txt',uniqueproperties,'utf8');
}
});
2 changes: 2 additions & 0 deletions bin/xml_to_json/src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!*.gitignore