├── .gitignore ├── Experiments ├── test.txt ├── external-test.jsx └── BTSample.jsx ├── Script Panel 2 ├── Other_Tools │ ├── Other_Tools.txt │ ├── Other_Tools.png │ └── toolbox │ │ └── Test.jsx ├── test-script-1.jsx └── test-script-2.jsx ├── README.md ├── Variable Importer ├── README.md └── RenameArtFromText.jsx ├── Dataset Processing ├── DealWithOversetText_SingleLine.jsx ├── CreateCommandLayer.jsx └── Recolor.jsx ├── Hobo Swatches └── Hobo Swatches_v1.jsx └── Script Panel └── ScriptPanel.jsx /.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Experiments/test.txt: -------------------------------------------------------------------------------- 1 | !!! -------------------------------------------------------------------------------- /Script Panel 2/Other_Tools/Other_Tools.txt: -------------------------------------------------------------------------------- 1 | { 2 | "sectionColor" : "#F00", 3 | "name" : "OTHER tools." 4 | } -------------------------------------------------------------------------------- /Script Panel 2/test-script-1.jsx: -------------------------------------------------------------------------------- 1 | //@target illustrator 2 | function test_1 () { 3 | alert("Hello World!"); 4 | } 5 | test_1(); -------------------------------------------------------------------------------- /Script Panel 2/Other_Tools/Other_Tools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Silly-V/Adobe-Illustrator/HEAD/Script Panel 2/Other_Tools/Other_Tools.png -------------------------------------------------------------------------------- /Experiments/external-test.jsx: -------------------------------------------------------------------------------- 1 | //@targetengine main 2 | // Window.find("palette", "BTSample").addedCustomMethods.callMakeASquare({ x : 400, y : -300 }); 3 | Window.find("dialog", "BTSample").addedCustomMethods.callMakeACircle([200, -400]); 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Adobe-Illustrator 2 | Some useful Adobe Illustrator scripts 3 | 4 | This code repository supports an Independent and Sovereign Ukraine. 5 | 6 | ![image](https://user-images.githubusercontent.com/11342704/156908458-13f97e8e-1bf5-4b33-b915-3b2b99f71d5e.png) 7 | 8 | -------------------------------------------------------------------------------- /Script Panel 2/test-script-2.jsx: -------------------------------------------------------------------------------- 1 | //@target illustrator 2 | function test_2 () { 3 | // function encodeBT (str) { 4 | // return (encodeURI(str)).replace(/"/g, "|||&ld" + "quo;|||").replace(/'/g, "|||&ap" + "os;|||"); 5 | // } 6 | // function decodeBT (str) { 7 | // const undisguisedString = str.replace(/\|\|\|“\|\|\|/g, '"').replace(/\|\|\|'\|\|\|/g, "'"); 8 | // const strURIDecoded = decodeURI(undisguisedString); 9 | // return strURIDecoded; 10 | // } 11 | 12 | // var s = (encodeBT("'HEY!'")); 13 | // alert(decodeBT(s)); 14 | 15 | // var s = "\u0027"; 16 | 17 | // var word = "ANC" + s + "s"; 18 | // var word2 = "ANC's"; 19 | // alert(word.length + "\n" + word2.length + "\n" + (word === word2)); 20 | // alert(word.replace(/'/g, "*")); 21 | 22 | alert("'Hey!!'"); 23 | } 24 | test_2(); -------------------------------------------------------------------------------- /Variable Importer/README.md: -------------------------------------------------------------------------------- 1 | # Variable Importer Pro 2 | For over a decade, `VariableImporter.jsx` has powered workflows for thousands of companies worldwide. 3 | Now in 2025, we’re excited to introduce **Darty-Ai** — a revolutionary new way to control the vast majority of Adobe Illustrator’s tools, all through a simple spreadsheet interface. 4 | 5 | With Darty-Ai, you can effortlessly: 6 | * Apply colors, strokes, and fills to objects and text 7 | * Use nearly all appearance settings available in Illustrator’s Appearance panel — including most effects 8 | * Control object, artboard, layer, and style attributes 9 | * Align and distribute objects with precision 10 | * Edit text content and properties without resetting styles or formatting 11 | * Precisely place graphics and text files 12 | * Transform, duplicate, group, delete, and apply pathfinder operations to objects 13 | * Export files with full control using variables 14 | * ...and so much more. 15 | 16 | A free version is available — try it now at [darty.ai](https://darty.ai) 17 | -------------------------------------------------------------------------------- /Variable Importer/RenameArtFromText.jsx: -------------------------------------------------------------------------------- 1 | #target illustrator function RenameArtFromText(){ if(app.documents.length > 0 && app.documents[0].selection.length){ function getTextFile(){ var fileType = ($.os.match("Windows"))? "*.txt;*.csv;": function(f){return f instanceof Folder || (f instanceof File && f.displayName.match(/(\.txt|\.csv)$/i));} ; var textFile = File.openDialog("Choose a text file.", fileType); if(textFile != null){ return textFile; } else { alert("Canceled"); return null; } }; var textFile = getTextFile(); if(textFile!=null){ textFile.open('r'); var namesArray = textFile.read().split("\n"); textFile.close(); var doc = app.activeDocument; for(var i = 0; i < namesArray.length; i++){ try{ var thisName = namesArray[i]; var thisItem = doc.selection[i]; thisItem.name = thisName; } catch(e){ // do nothing } } alert("Done with " + i + " names"); } } else { alert("No AI document is open or no selection."); } } RenameArtFromText(); -------------------------------------------------------------------------------- /Script Panel 2/Other_Tools/toolbox/Test.jsx: -------------------------------------------------------------------------------- 1 | /*** 2 | { 3 | "scriptName" : "PS User-Data", 4 | "note" : "Shows a printout of user data, from Photoshop." 5 | } 6 | ***/ 7 | //@target photoshop 8 | function testPSUserData () { 9 | 10 | function getSystemCommandStdout (command) { 11 | var stdout = null; 12 | var tempFile = new File(Folder.temp + "/jsx_compname_temp.txt"); 13 | app.system(command + " > " + tempFile.fsName); 14 | if (tempFile.open("r")) { 15 | stdout = tempFile.read(); 16 | tempFile.close(); 17 | tempFile.remove(); 18 | } 19 | return stdout; 20 | } 21 | 22 | function getUserData ( 23 | scriptName, 24 | methodName, 25 | ) { 26 | var data = { 27 | appName : BridgeTalk.appName, 28 | scriptName : testPSUserData.name, 29 | methodName : testPSUserData.name, 30 | computerName : ($.os.toLowerCase().indexOf("win") > -1) ? $.getenv("COMPUTERNAME") : getSystemCommandStdout ("hostname -s"), 31 | userName : $.getenv($.os.indexOf("Windows") > -1? "USERNAME" : "USER"), 32 | adobeUser : app.userAdobeID, 33 | appVersion : app.version, 34 | locale : $.locale, 35 | timestamp : new Date().getTime(), 36 | }; 37 | return data; 38 | } 39 | 40 | function getDataDisplay (data) { 41 | var msg = ""; 42 | for (var all in data) { 43 | msg += (all + " : " + data[all] + "\n"); 44 | } 45 | return msg; 46 | } 47 | 48 | alert( 49 | getDataDisplay( 50 | getUserData() 51 | ) 52 | ); 53 | } 54 | 55 | testPSUserData(); -------------------------------------------------------------------------------- /Dataset Processing/DealWithOversetText_SingleLine.jsx: -------------------------------------------------------------------------------- 1 | function DealWithOversetText_SingleLine() { 2 | var defaultSizeTagName = "overset_text_default_size"; 3 | var defaultIncrement = 0.1; 4 | 5 | function recordFontSizeInTag(size, art){ 6 | var tag; 7 | var tags = art.tags; 8 | try { 9 | tag = tags.getByName(defaultSizeTagName); 10 | tag.value = size; 11 | } catch(e) { 12 | tag = tags.add(); 13 | tag.name = defaultSizeTagName; 14 | tag.value = size; 15 | } 16 | }; 17 | 18 | function readFontSizeFromTag(art){ 19 | var tag; 20 | var tags = art.tags; 21 | try { 22 | tag = tags.getByName(defaultSizeTagName); 23 | return tag.value * 1; 24 | } catch(e) { 25 | return null; 26 | } 27 | }; 28 | 29 | function recordFontSize() { 30 | var doc = app.activeDocument; 31 | for (var i = 0; i < doc.textFrames.length; i++) { 32 | var t = doc.textFrames[i]; 33 | if ((t.kind == TextType.AREATEXT || t.kind == TextType.PATHTEXT) && t.editable && !t.locked && !t.hidden) { 34 | // t.note = t.textRange.characterAttributes.size; 35 | recordFontSizeInTag(t.textRange.characterAttributes.size, t); 36 | } 37 | }; 38 | }; 39 | 40 | function isOverset(textBox, lineAmt) { 41 | if (textBox.lines.length > 0) { 42 | var charactersOnVisibleLines = 0; 43 | if(typeof(lineAmt) != "undefined"){ 44 | lineAmt = 1; 45 | } 46 | for (var i = 0; i < lineAmt; i++) { 47 | charactersOnVisibleLines += textBox.lines[i].characters.length; 48 | } 49 | if (charactersOnVisibleLines < textBox.characters.length) { 50 | return true; 51 | } else { 52 | return false; 53 | } 54 | } else if (textBox.characters.length > 0) { 55 | return true; 56 | } 57 | }; 58 | 59 | function shrinkFont(textBox) { 60 | var totalCharCount = textBox.characters.length; 61 | var lineCount = textBox.lines.length; 62 | if (textBox.lines.length > 0) { 63 | var firstLineCharCount = textBox.lines[0].characters.length; 64 | if (isOverset(textBox, lineCount)) { 65 | var inc = defaultIncrement; 66 | while (isOverset(textBox, lineCount)) { 67 | textBox.textRange.characterAttributes.size -= inc; 68 | } 69 | } 70 | } else if (textBox.characters.length > 0) { 71 | var inc = defaultIncrement; 72 | while (isOverset(textBox, lineCount)) { 73 | textBox.textRange.characterAttributes.size -= inc; 74 | } 75 | } 76 | }; 77 | 78 | function resetSize(textAreaBox) { 79 | var t = textAreaBox; 80 | if (t.contents != "") { 81 | // if (t.note != "") { 82 | // t.textRange.characterAttributes.size = (t.note * 1); 83 | // } 84 | var size = readFontSizeFromTag(t); 85 | if(size != null){ 86 | t.textRange.characterAttributes.size = size; 87 | } 88 | } 89 | }; 90 | 91 | function removeTagsOnText(){ 92 | var doc = app.activeDocument; 93 | for (var i = 0; i < doc.textFrames.length; i++) { 94 | try { 95 | doc.textFrames[i].tags.getByName(defaultSizeTagName).remove(); 96 | } catch (e) { 97 | 98 | } 99 | } 100 | }; 101 | 102 | function resetAllTextBoxes() { 103 | for (var i = 0; i < doc.textFrames.length; i++) { 104 | var t = doc.textFrames[i]; 105 | if ((t.kind == TextType.AREATEXT || t.kind == TextType.PATHTEXT) && t.editable && !t.locked && !t.hidden) { 106 | resetSize(t); 107 | } 108 | }; 109 | }; 110 | 111 | function shrinkAllTextBoxes() { 112 | for (var i = 0; i < doc.textFrames.length; i++) { 113 | var t = doc.textFrames[i]; 114 | if ((t.kind == TextType.AREATEXT || t.kind == TextType.PATHTEXT) && t.editable && !t.locked && !t.hidden) { 115 | shrinkFont(t); 116 | } 117 | }; 118 | }; 119 | if (app.documents.length > 0) { 120 | var doc = app.activeDocument; 121 | if (doc.dataSets.length > 0 && doc.activeDataSet == doc.dataSets[0]) { 122 | recordFontSize(); 123 | } 124 | resetAllTextBoxes(); 125 | shrinkAllTextBoxes(); 126 | if (doc.dataSets.length > 0 && doc.activeDataSet == doc.dataSets[doc.dataSets.length - 1]) { 127 | removeTagsOnText(); 128 | } 129 | } 130 | return true; 131 | }; 132 | DealWithOversetText_SingleLine(); 133 | -------------------------------------------------------------------------------- /Dataset Processing/CreateCommandLayer.jsx: -------------------------------------------------------------------------------- 1 | #target illustrator 2 | function CreateCommandLayer () { 3 | if (!Array.prototype.indexOf) { 4 | Array.prototype.indexOf = function (searchElement, fromIndex) { 5 | var k; 6 | if (this == null) { 7 | throw new TypeError('"this" is null or not defined'); 8 | } 9 | var o = Object(this); 10 | var len = o.length >>> 0; 11 | if (len === 0) { 12 | return -1; 13 | } 14 | var n = +fromIndex || 0; 15 | if (Math.abs(n) === Infinity) { 16 | n = 0; 17 | } 18 | if (n >= len) { 19 | return -1; 20 | } 21 | k = Math.max(n >= 0 ? n : len - Math.abs(n), 0); 22 | while (k < len) { 23 | if (k in o && o[k] === searchElement) { 24 | return k; 25 | } 26 | k++; 27 | } 28 | return -1; 29 | }; 30 | }; 31 | var CSV={parse:function(r,n,e){e=e||",",n=n||function(r,n,e){return e};for(var t,f,i,o=r.split(""),u=0,l=o.length,g=[];u -1; i--) { 142 | makeCommandTextFrame(newCommandLayer, dataObj["source text name"][i], dataObj["target note"][i], dataObj["method"][i], dataObj["parameter"][i]); 143 | } 144 | if (confirm("Make 'Recoloring Variable Text' layer?")) { 145 | try { 146 | var existingRecoloringLayer = doc.layers.getByName("Recoloring Variable Text"); 147 | if (confirm("Existing 'Recoloring Variable Text' layer found. Remove and proceed?")) { 148 | existingRecoloringLayer.remove(); 149 | } else { 150 | return; 151 | } 152 | } catch (e) { 153 | 154 | } 155 | var newRecoloringLayer = doc.layers.add(); 156 | newRecoloringLayer.name = "Recoloring Variable Text"; 157 | var thisSourceTextName; 158 | var newText; 159 | for (var i = dataObj["source text name"].length - 1; i > -1; i--) { 160 | thisSourceTextName = dataObj["source text name"][i]; 161 | newText = newRecoloringLayer.textFrames.add(); 162 | newText.contents = "text for " + thisSourceTextName; 163 | newText.name = thisSourceTextName; 164 | } 165 | } 166 | }; 167 | CreateCommandLayer(); 168 | -------------------------------------------------------------------------------- /Experiments/BTSample.jsx: -------------------------------------------------------------------------------- 1 | //@target illustrator 2 | //@targetengine main 3 | function BTSample () { 4 | 5 | "object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(t){return 10>t?"0"+t:t}function quote(t){ 6 | return escapable.lastIndex=0,escapable.test(t)?'"'+t.replace(escapable,function(t){var e=meta[t]; 7 | return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'} 8 | function str(t,e){var n,r,o,f,u,i=gap,p=e[t];switch(p&&"object"==typeof p&&"function"==typeof p.toJSON&&(p=p.toJSON(t)), 9 | "function"==typeof rep&&(p=rep.call(e,t,p)),typeof p){case"string":return quote(p);case"number":return isFinite(p)?String(p):"null"; 10 | case"boolean":case"null":return String(p);case"object":if(!p)return"null";if(gap+=indent,u=[],"[object Array]"===Object.prototype.toString.apply(p)){ 11 | for(f=p.length,n=0;f>n;n+=1)u[n]=str(n,p)||"null";return o=0===u.length?"[]":gap?"[\n"+gap+u.join(",\n"+gap)+"\n"+i+"]":"["+u.join(",")+"]",gap=i,o} 12 | if(rep&&"object"==typeof rep)for(f=rep.length,n=0;f>n;n+=1)"string"==typeof rep[n]&&(r=rep[n],o=str(r,p),o&&u.push(quote(r)+(gap?": ":":")+o)); 13 | else for(r in p)Object.prototype.hasOwnProperty.call(p,r)&&(o=str(r,p),o&&u.push(quote(r)+(gap?": ":":")+o));return o=0===u.length?"{}":gap?"{\n"+gap+ 14 | u.join(",\n"+gap)+"\n"+i+"}":"{"+u.join(",")+"}",gap=i,o}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){ 15 | return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+ 16 | f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){ 17 | return this.valueOf()});var cx,escapable,gap,indent,meta,rep;"function"!=typeof JSON.stringify&& 18 | (escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, 19 | meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(t,e,n){var r; 20 | if(gap="",indent="","number"==typeof n)for(r=0;n>r;r+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=e, 21 | e&&"function"!=typeof e&&("object"!=typeof e||"number"!=typeof e.length))throw new Error("JSON.stringify");return str("",{"":t})}), 22 | "function"!=typeof JSON.parse&&(cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, 23 | JSON.parse=function(text,reviver){function walk(t,e){var n,r,o=t[e];if(o&&"object"==typeof o)for(n in o)Object.prototype.hasOwnProperty.call(o,n)&& 24 | (r=walk(o,n),void 0!==r?o[n]=r:delete o[n]);return reviver.call(t,e,o)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&& 25 | (text=text.replace(cx,function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})), 26 | /^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@") 27 | .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]") 28 | .replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j; 29 | throw new SyntaxError("JSON.parse")})}(); 30 | 31 | // * One line to easily feed into BT call. 32 | function hexDecode (str) { var r=''; for (var i = 0; i < str.length; i += 2){ r += unescape('%' + str.substr(i, 2));} return r; } 33 | 34 | function hexEncode (str) { 35 | var r = ''; var i = 0; var h; while (i < str.length) { h = str.charCodeAt(i++).toString(16); while (h.length < 2) { h = h; } r += h; } return r; 36 | } 37 | 38 | function getTrimmedError (errorMessage) { 39 | var displayMessage = errorMessage; 40 | if (displayMessage.length > 200) { 41 | displayMessage = displayMessage.substring(0, 200); 42 | } 43 | return displayMessage; 44 | } 45 | 46 | function styleThePath (pathItem) { 47 | pathItem.stroked = true; 48 | pathItem.strokeWidth = 4; 49 | pathItem.strokeColor = app.activeDocument.swatches.getByName("Black").color; 50 | } 51 | 52 | function checkDocument () { 53 | if (app.documents.length == 0) { 54 | throw new Error(BTSample.name + ": No documents are open."); 55 | } 56 | } 57 | 58 | function makeACircle (xy) { 59 | checkDocument(); 60 | var doc = app.activeDocument; 61 | var x = xy[0]; // * Array argument example. 62 | var y = xy[1]; 63 | var circle = doc.pathItems.ellipse(y, x, 60, 60); 64 | styleThePath(circle); 65 | return { circleResult : "A circle was made at [" + x + ", " + y + "]." }; 66 | } 67 | 68 | function makeASquare (xyObj) { 69 | checkDocument(); 70 | var x = xyObj.x; 71 | var y = xyObj.y; 72 | var doc = app.activeDocument; 73 | var square = doc.pathItems.rectangle(y, x, 60, 60); 74 | styleThePath(square); 75 | return { squareResult : "A square was made at [" + x + ", " + y + "]." }; 76 | } 77 | 78 | function checkMethod (methodName) { 79 | if (!methodName || typeof methodName !== "string") { 80 | throw new Error("Method is invalid"); 81 | } 82 | var availableMethods = "|" + [ 83 | makeACircle.name, 84 | makeASquare.name 85 | ].join("||") + "|"; 86 | if (availableMethods.indexOf("|" + methodName + "|") == -1) { 87 | throw new Error("Method '" + methodName + "' is not among the available methods: [" + availableMethods.split("||").replace(/\|/g, "") + "]."); 88 | } 89 | return true; 90 | } 91 | 92 | // * An object which is a dictionary of methods and their names. A method can be called by using its name and accessing this object. 93 | const METHODS = { 94 | "makeASquare" : makeASquare, 95 | "makeACircle" : makeACircle, 96 | }; 97 | 98 | /** 99 | * The method which sends this entire script and running instructions via BridgeTalk. 100 | * @param {string} methodName - Method that will execute out of this script. 101 | * @param { Record | any[] | boolean | string | number } arguments - An argument which will be serialized into JSON. 102 | * @param {(res: { body: string }) => void} [onResult] - Optional method to perform a follow-up action in the ScriptUI window. 103 | */ 104 | function makeBTCall (appName, methodName, arguments, onResult) { 105 | checkMethod(methodName); 106 | var argString = ""; 107 | if (typeof arguments == "object" && arguments !== null) { 108 | argString = JSON.stringify(arguments); 109 | } else if (arguments instanceof Array) { 110 | argString = JSON.stringify(arguments); 111 | } else if (typeof arguments == "boolean") { 112 | argString = JSON.stringify({ booleanValue : arguments }); 113 | } else if (typeof arguments == "string") { 114 | argString = JSON.stringify({ stringValue : arguments }); 115 | } else if (typeof arguments == "number") { 116 | argString = JSON.stringify({ numberValue : arguments }); 117 | } 118 | if (argString) { 119 | argString = "JSON.parse(hexDecode('" + hexEncode(argString) + "'))"; 120 | } 121 | 122 | var callLine = BTSample.name + "('" + methodName + "'" + ((argString ? ", " + argString : "")) + ");"; 123 | 124 | var scriptString = hexDecode + "; eval(decodeURI(hexDecode('" + hexEncode( 125 | encodeURI( 126 | BTSample.toString() + "\n" + 127 | callLine 128 | ) 129 | ) + "')));"; 130 | var bt = new BridgeTalk(); 131 | bt.target = appName; 132 | bt.onError = function (error) { 133 | alert(getTrimmedError(error.body)); 134 | } 135 | bt.onResult = onResult || function (result) { 136 | alert(result.body); 137 | } 138 | 139 | bt.body = scriptString; 140 | bt.send(); 141 | } 142 | 143 | function start () { 144 | var w = new Window("palette", BTSample.name); 145 | var g1 = w.add("group"); 146 | var btn_1 = g1.add("button", undefined, "Action 1"); 147 | var btn_2 = g1.add("button", undefined, "Action 2"); 148 | 149 | function callMakeACircle (xyArray) { 150 | makeBTCall(BridgeTalk.appName, makeACircle.name, xyArray, function (res) { 151 | var parsedBody = JSON.parse(res.body); 152 | e_res.text = parsedBody.result.circleResult || parsedBody.result; 153 | }); 154 | }; 155 | 156 | function callMakeASquare (xyObj) { 157 | makeBTCall(BridgeTalk.appName, makeASquare.name, xyObj, function (res) { 158 | var parsedBody = JSON.parse(res.body); 159 | e_res.text = parsedBody.result.squareResult || parsedBody.result; 160 | }); 161 | }; 162 | 163 | btn_1.onClick = function () { callMakeACircle([0, 50]); } 164 | btn_2.onClick = function () { callMakeASquare({ x : 50, y : 0 }); } 165 | 166 | var g2 = w.add("panel", undefined, "Result:"); 167 | var e_res = g2.add("edittext", undefined, ""); 168 | e_res.characters = 20; 169 | 170 | // * Amazingly, adding this to the window allows the methods to be accessed directly, from a separate JSX file. 171 | // * This is not necessary when calling from CEP where the window-creating code is stored. 172 | // * However, it is necessary to create this object and not assign a function in a loop of `METHODS` keys - then it acts weird and only does `makeACircle`. 173 | w.addedCustomMethods = { 174 | callMakeASquare : callMakeASquare, 175 | callMakeACircle : callMakeACircle, 176 | }; 177 | 178 | w.show(); 179 | } 180 | 181 | // * When this script is called for any reason, this entry point decides on how it will be executed. 182 | if (arguments.length == 1) { 183 | if (arguments[0] == start.name) { 184 | start(); 185 | } 186 | // * Add any other methods that have no arguments to run them. 187 | } else if (arguments.length == 2) { 188 | var inputMethodString = arguments[0]; 189 | checkMethod(inputMethodString); 190 | var inputArgObj = arguments[1]; 191 | 192 | var result; 193 | try { 194 | result = METHODS[inputMethodString](inputArgObj); 195 | } catch (error) { 196 | result = "ERR_:" + getTrimmedError(error.message); 197 | } 198 | return JSON.stringify({ result : result }); 199 | } 200 | 201 | } 202 | BTSample("start"); /* // * Cut this part out when using from CEP and just use the "start" as the evalScript method name (Ex: `evalScript("start")`). */ -------------------------------------------------------------------------------- /Dataset Processing/Recolor.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * @@@BUILDINFO@@@ Recolor.jsx !Version! Tue Sep 26 2017 22:55:16 GMT-0500 3 | */ 4 | 5 | var script = ( 6 | function init() { 7 | if (!Array.prototype.indexOf) { 8 | Array.prototype.indexOf = function(searchElement, fromIndex) { 9 | var k; 10 | if (this == null) { 11 | throw new TypeError('"this" is null or not defined'); 12 | } 13 | var O = Object(this); 14 | var len = O.length >>> 0; 15 | if (len === 0) { 16 | return -1; 17 | } 18 | var n = +fromIndex || 0; 19 | if (Math.abs(n) === Infinity) { 20 | n = 0; 21 | } 22 | if (n >= len) { 23 | return -1; 24 | } 25 | k = Math.max(n >= 0 ? n : len - Math.abs(n), 0); 26 | while (k < len) { 27 | if (k in O && O[k] === searchElement) { 28 | return k; 29 | } 30 | k++; 31 | } 32 | return -1; 33 | }; 34 | }; 35 | String.prototype.trim = function () { 36 | return this.replace(/^\s+|\s+$/gm,''); 37 | }; 38 | function getInstructionFromString(stringInput){ 39 | var resObj = {}; 40 | var baseProperties = ["SOURCETEXT", "TARGETNOTE"]; 41 | var applicationProperties = ["APPLYCOLOR", "APPLYSWATCH", "APPLYSTYLE"]; 42 | var propCheckBase = [], propCheckApp = []; 43 | var rawContent = stringInput.split(/[\r\n]/g); 44 | var row, splitRow = []; 45 | try { 46 | for (var i = 0; i < rawContent.length; i++) { 47 | row = rawContent[i]; 48 | splitRow = row.split(/:/g); 49 | if(splitRow.length == 2){ 50 | resObj[splitRow[0].trim()] = splitRow[1].trim(); 51 | } 52 | }; 53 | } catch (e){ 54 | return null; 55 | } 56 | for(var all in resObj){ 57 | if(propCheckBase.indexOf(all) == -1){ 58 | if(baseProperties.indexOf(all) > -1){ 59 | propCheckBase.push(all); 60 | } 61 | } 62 | if(propCheckApp.indexOf(all) == -1){ 63 | if(baseProperties.indexOf(all) > -1){ 64 | propCheckApp.push(all); 65 | } 66 | } 67 | } 68 | if(propCheckBase.length > 1 && propCheckApp.length > 0){ 69 | return resObj; 70 | } 71 | return null; 72 | }; 73 | function getCommandObjProperties(artObj){ 74 | var a = artObj; 75 | var resObj; 76 | 77 | if(a.note != ""){ 78 | resObj = getInstructionFromString(a.note); 79 | if(resObj != null && typeof(resObj) != "undefined"){ 80 | return resObj; 81 | } 82 | } 83 | if(a.typename == "TextFrame"){ 84 | resObj = getInstructionFromString(a.contents); 85 | if(resObj != null && typeof(resObj) != "undefined"){ 86 | return resObj; 87 | } 88 | } 89 | return null; 90 | } 91 | function hexToRgb(hex) { 92 | // http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb 93 | // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF") 94 | var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; 95 | hex = hex.replace(shorthandRegex, function(m, r, g, b) { 96 | return r + r + g + g + b + b; 97 | }); 98 | var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); 99 | return [result[1], result[2], result[3]] ? [ 100 | parseInt(result[1], 16), 101 | parseInt(result[2], 16), 102 | parseInt(result[3], 16) 103 | ] : null; 104 | } 105 | function getColorNumbers(sourceTextContent){ 106 | // gets colors from these patterns: 107 | // #FFFFFF, rgb(255,255,255), rgba(255,255,255,1), cmyk(0,0,0,0) 108 | var s = sourceTextContent.toString(); 109 | var rx_hex = /^#(?:[0-9a-f]{3}){1,2}$/i; 110 | var rx_rgb = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i; 111 | var rx_cmyk = /^cmyk\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i; 112 | if(s.match(rx_hex)){ 113 | return hexToRgb(s); 114 | } else if(s.match(rx_rgb)){ 115 | var m = s.match(rx_rgb); 116 | return [m[1], m[2], m[3]]; 117 | } else if(s.match(rx_cmyk)){ 118 | var m = s.match(rx_cmyk); 119 | return [m[1], m[2], m[3], m[4]]; 120 | } 121 | } 122 | function buildProcessColor(numbers){ 123 | var n = numbers, result; 124 | if(app.activeDocument.documentColorSpace == DocumentColorSpace.RGB){ 125 | result = new RGBColor(); 126 | if(n.length == 4){ 127 | var c = app.convertSampleColor(ImageColorSpace.CMYK, n, ImageColorSpace.RGB, ColorConvertPurpose.defaultpurpose); 128 | result.red = c[0]; 129 | result.green = c[1]; 130 | result.blue = c[2]; 131 | } else { 132 | result.red = n[0]; 133 | result.green = n[1]; 134 | result.blue = n[2]; 135 | } 136 | } else { 137 | result = new CMYKColor(); 138 | if(n.length == 3){ 139 | var c = app.convertSampleColor(ImageColorSpace.RGB, n, ImageColorSpace.CMYK, ColorConvertPurpose.defaultpurpose); 140 | result.cyan = c[0]; 141 | result.magenta = c[1]; 142 | result.yellow = c[2]; 143 | result.black = c[3]; 144 | } else { 145 | result.cyan = n[0]; 146 | result.magenta = n[1]; 147 | result.yellow = n[2]; 148 | result.black = n[3]; 149 | } 150 | } 151 | return result; 152 | } 153 | function applyStrokeProcessColor(artObj, processColor){ 154 | if(artObj.typename == "PathItem"){ 155 | artObj.strokeColor = processColor; 156 | } else if(artObj.typename == "TextFrame"){ 157 | if(artObj.textRange.characterAttributes.strokeColor != "[NoColor]"){ 158 | artObj.textRange.characterAttributes.strokeColor = processColor; 159 | } 160 | } else if(artObj.typename == "CompoundPathItem"){ 161 | applyStrokeProcessColor(artObj.pathItems[0], processColor) 162 | } 163 | } 164 | function getNoneSwatchColor(){ 165 | return app.activeDocument.swatches.getByName("[None]").color; 166 | } 167 | function applyFillProcessColor(artObj, processColor){ 168 | if(artObj.typename == "PathItem"){ 169 | artObj.fillColor = processColor; 170 | } else if(artObj.typename == "TextFrame"){ 171 | artObj.textRange.characterAttributes.fillColor = processColor; 172 | } else if(artObj.typename == "CompoundPathItem"){ 173 | applyFillProcessColor(artObj.pathItems[0], processColor) 174 | } 175 | } 176 | 177 | function applyStrokeSwatch(artObj, chosenSwatch){ 178 | if(artObj.typename == "PathItem"){ 179 | artObj.strokeColor = chosenSwatch.color; 180 | } else if(artObj.typename == "TextFrame"){ 181 | if(artObj.textRange.characterAttributes.strokeColor != "[NoColor]"){ 182 | artObj.textRange.characterAttributes.strokeColor = chosenSwatch.color; 183 | } 184 | } else if(artObj.typename == "CompoundPathItem"){ 185 | applyStrokeSwatch(artObj.pathItems[0], chosenSwatch) 186 | } 187 | } 188 | function applyFillSwatch(artObj, chosenSwatch){ 189 | if(artObj.typename == "PathItem"){ 190 | artObj.fillColor = chosenSwatch.color; 191 | } else if(artObj.typename == "TextFrame"){ 192 | artObj.textRange.characterAttributes.fillColor = chosenSwatch.color; 193 | } else if(artObj.typename == "CompoundPathItem"){ 194 | applyFillSwatch(artObj.pathItems[0], chosenSwatch) 195 | } 196 | } 197 | var actionsObj = { 198 | APPLYCOLOR : function(artObj, param, sourceTextContent){ 199 | // param: STROKE, FILL, FILLANDSTROKE 200 | var processColor; 201 | if(sourceTextContent.trim() == "[None]"){ 202 | processColor = getNoneSwatchColor(); 203 | } else { 204 | processColor = buildProcessColor(getColorNumbers(sourceTextContent)); 205 | } 206 | if(param == "STROKE"){ 207 | applyStrokeProcessColor(artObj, processColor); 208 | } else if(param == "FILL"){ 209 | applyFillProcessColor(artObj, processColor); 210 | } else if(param == "FILLANDSTROKE"){ 211 | applyStrokeProcessColor(artObj, processColor); 212 | applyFillProcessColor(artObj, processColor); 213 | } 214 | }, 215 | APPLYSTYLE : function(artObj, param, sourceTextContent){ 216 | // param: APPLY, MERGE 217 | var chosenStyle = app.activeDocument.graphicStyles.getByName(sourceTextContent); 218 | if(param == "APPLY"){ 219 | chosenStyle.applyTo(artObj); 220 | } else if(param == "MERGE"){ 221 | chosenStyle.mergeTo(artObj); 222 | } 223 | }, 224 | APPLYSWATCH : function(artObj, param, sourceTextContent){ 225 | // param: STROKE, FILL, FILLANDSTROKE 226 | var chosenSwatch = app.activeDocument.swatches.getByName(sourceTextContent); 227 | if(param == "STROKE"){ 228 | applyStrokeSwatch(artObj, chosenSwatch); 229 | } else if(param == "FILL"){ 230 | applyFillSwatch(artObj, chosenSwatch); 231 | } else if(param == "FILLANDSTROKE"){ 232 | applyStrokeSwatch(artObj, chosenSwatch); 233 | applyFillSwatch(artObj, chosenSwatch); 234 | } 235 | } 236 | } 237 | function performAction(doc, action, allPageItems){ 238 | var sourceText, sourceTextContent; 239 | try { 240 | sourceText = doc.pageItems.getByName(action["SOURCETEXT"]); 241 | sourceTextContent = sourceText.contents.toString().trim(); 242 | var item, param; 243 | for (var i = 0; i < allPageItems.length; i++) { 244 | item = allPageItems[i]; 245 | if(!item.editable){ 246 | continue; 247 | } 248 | if(item.note.trim() == action["TARGETNOTE"]){ 249 | for(var all in action){ 250 | if(all != "SOURCETEXT" && all != "TARGETNOTE"){ 251 | param = action[all]; 252 | actionsObj[all](item, param, sourceTextContent); 253 | } 254 | } 255 | } 256 | }; 257 | } catch(e){ 258 | return; 259 | } 260 | } 261 | 262 | function execute(){ 263 | if(app.documents.length == 0){ 264 | return; 265 | } 266 | var doc = app.activeDocument; 267 | var commandLayer, commands = [], allPageItems = []; 268 | try{ 269 | commandLayer = doc.layers.getByName("COMMAND"); 270 | var item, command; 271 | for (var i = 0; i < commandLayer.pageItems.length; i++) { 272 | item = commandLayer.pageItems[i]; 273 | command = getCommandObjProperties(item); 274 | if(command != null){ 275 | commands.push(command); 276 | } 277 | }; 278 | if(commands.length > 0){ 279 | for (var i = 0; i < doc.pageItems.length; i++) { 280 | allPageItems.push(doc.pageItems[i]); 281 | } 282 | } 283 | } catch(e){ 284 | return; 285 | } 286 | var thisAction; 287 | 288 | for (var i = 0; i < commands.length; i++) { 289 | thisAction = commands[i]; 290 | performAction(doc, thisAction, allPageItems); 291 | }; 292 | } 293 | 294 | return {execute : execute}; 295 | } 296 | )(); 297 | 298 | script.execute(); -------------------------------------------------------------------------------- /Hobo Swatches/Hobo Swatches_v1.jsx: -------------------------------------------------------------------------------- 1 | //==================================================HOBO SWATCHES by Vasily ===========================================// // BETA /** * @@@BUILDINFO@@@ Hobo Swatches_v1.jsx !Version! Sat Jan 18 2014 22:36:40 GMT-0600 */ function swatchPalette(){ //===================================================Icon Resources========================// var infoBtnSrc='({total:2, '+ 'shape_1:{fillColor:[0.11, 0.18, 1], name:"", tag:"", strokeColor:null, pathPoints:[10, 3, 5, 5], ellipsePath:true, closed:true}, '+ 'shape_0:{fillColor:[0.11, 0.18, 1], name:"", tag:"", strokeColor:null, pathPoints:[[15, 15], [15, 11], [18, 11], [18, 9], [13, 9], [8, 9], [8, 11], [11, 11], [11, 15], [7, 15], [7, 17], [19, 17], [19, 15]], ellipsePath:false, closed:true}})'; var addBtnSrc='({total:1, '+ 'group_0:{'+ 'shape_1:{fillColor:null, name:"", tag:"", strokeColor:[0, 0.14, 1], pathPoints:[[19, 9], [14, 9], [14, 4], [12, 4], [12, 9], [7, 9], [7, 11], [12, 11], [12, 16], [14, 16], [14, 11], [19, 11]], ellipsePath:false, closed:true, strokeWidth:2}, '+ 'shape_0:{fillColor:[1, 1, 0], name:"", tag:"", strokeColor:null, pathPoints:[[19, 9], [14, 9], [14, 4], [12, 4], [12, 9], [7, 9], [7, 11], [12, 11], [12, 16], [14, 16], [14, 11], [19, 11]], ellipsePath:false, closed:true}, total:2}})'; var rmvBtnSrc='({total:2, '+ 'shape_1:{fillColor:null, name:"", tag:"", strokeColor:[0, 0.22, 0], pathPoints:[[20, 9], [6, 9], [6, 11], [20, 11]], ellipsePath:false, closed:true, strokeWidth:3}, '+ 'shape_0:{fillColor:[0.27, 1, 0], name:"", tag:"", strokeColor:null, pathPoints:[[20, 9], [6, 9], [6, 11], [20, 11]], ellipsePath:false, closed:true}})'; var rstBtnSrc='({total:2, '+ 'group_1:{'+ 'shape_1:{fillColor:[1, 0, 0], name:"", tag:"", strokeColor:[0.14, 0.12, 0.13], pathPoints:[45, 4, 12, 12], ellipsePath:true, closed:true, strokeWidth:2}, '+ 'shape_0:{fillColor:null, name:"", tag:"", strokeColor:[0.14, 0.12, 0.13], pathPoints:[[51, 12], [51, 2]], ellipsePath:false, closed:false, strokeWidth:3}, total:2}, '+ 'group_0:{'+ 'shape_7:{fillColor:null, name:"", tag:"", strokeColor:[0.75, 0.36, 0], pathPoints:[[5, 16], [5, 5], [11, 5], [11, 10], [7, 10], [12, 15]], ellipsePath:false, closed:false, strokeWidth:2}, '+ 'shape_6:{fillColor:null, name:"", tag:"", strokeColor:[0.75, 0.36, 0], pathPoints:[[20, 5], [15, 5], [15, 15], [19, 15]], ellipsePath:false, closed:false, strokeWidth:2}, '+ 'shape_5:{fillColor:null, name:"", tag:"", strokeColor:[0.75, 0.36, 0], pathPoints:[[14, 10], [18, 10]], ellipsePath:false, closed:false, strokeWidth:2}, '+ 'shape_4:{fillColor:null, name:"", tag:"", strokeColor:[0.75, 0.36, 0], pathPoints:[[34, 5], [29, 5], [29, 15], [34, 15]], ellipsePath:false, closed:false, strokeWidth:2}, '+ 'shape_3:{fillColor:null, name:"", tag:"", strokeColor:[0.75, 0.36, 0], pathPoints:[[29, 10], [32, 10]], ellipsePath:false, closed:false, strokeWidth:2}, '+ 'shape_2:{fillColor:null, name:"", tag:"", strokeColor:[0.75, 0.36, 0], pathPoints:[[21, 15], [26, 15], [26, 10], [22, 10], [22, 5], [27, 5]], ellipsePath:false, closed:false, strokeWidth:2}, '+ 'shape_1:{fillColor:null, name:"", tag:"", strokeColor:[0.75, 0.36, 0], pathPoints:[[39, 16], [39, 5]], ellipsePath:false, closed:false, strokeWidth:2}, '+ 'shape_0:{fillColor:null, name:"", tag:"", strokeColor:[0.75, 0.36, 0], pathPoints:[[35, 5], [42, 5]], ellipsePath:false, closed:false, strokeWidth:2}, total:8}})'; var labModelSrc='({total:3, '+ 'shape_2:{fillColor:null, name:"", tag:"", strokeColor:[1, 1, 1], pathPoints:[[4, 2], [4, 8], [7, 8]], ellipsePath:false, closed:false, strokeWidth:2}, '+ 'shape_1:{fillColor:null, name:"", tag:"", strokeColor:[0, 1, 1], pathPoints:[[12, 3], [12, 8], [9, 8], [9, 5], [12, 5]], ellipsePath:false, closed:false, strokeWidth:2}, '+ 'shape_0:{fillColor:null, name:"", tag:"", strokeColor:[1, 1, 0], pathPoints:[[15, 2], [15, 8], [18, 8], [18, 5], [15, 5]], ellipsePath:false, closed:false, strokeWidth:2}})'; var cmykModelSrc='({total:4, '+ 'shape_3:{fillColor:[0, 1, 1], name:"", tag:"", strokeColor:null, pathPoints:[[2, 9], [5, 9], [5, 8], [3, 8], [3, 3], [5, 3], [5, 2], [2, 2]], ellipsePath:false, closed:true}, '+ 'shape_2:{fillColor:[1, 0, 1], name:"", tag:"", strokeColor:null, pathPoints:[[10, 3], [9, 3], [9, 4], [8, 4], [8, 3], [7, 3], [7, 2], [6, 2], [6, 3], [6, 5], [6, 9], [7, 9], [7, 5], [8, 5], [8, 6], [9, 6], [9, 5], [10, 5], [10, 9], [11, 9], [11, 2], [10, 2]], ellipsePath:false, closed:true}, '+ 'shape_1:{fillColor:[1, 1, 0], name:"", tag:"", strokeColor:null, pathPoints:[[16, 2], [16, 3], [15, 3], [15, 4], [14, 4], [14, 3], [13, 3], [13, 2], [12, 2], [12, 4], [13, 4], [13, 5], [14, 5], [14, 9], [15, 9], [15, 5], [16, 5], [16, 4], [17, 4], [17, 2]], ellipsePath:false, closed:true}, '+ 'group_0:{'+ 'shape_4:{fillColor:[0, 0, 0], name:"", tag:"", strokeColor:null, pathPoints:[[19, 5], [19, 2], [18, 2], [18, 9], [19, 9], [19, 6], [20, 6], [20, 5]], ellipsePath:false, closed:true}, '+ 'shape_3:{fillColor:[0, 0, 0], name:"", tag:"", strokeColor:null, pathPoints:[[20, 8], [21, 8], [21, 6], [20, 6]], ellipsePath:false, closed:true}, '+ 'shape_2:{fillColor:[0, 0, 0], name:"", tag:"", strokeColor:null, pathPoints:[[22, 9], [22, 8], [21, 8], [21, 9]], ellipsePath:false, closed:true}, '+ 'shape_1:{fillColor:[0, 0, 0], name:"", tag:"", strokeColor:null, pathPoints:[[21, 3], [20, 3], [20, 5], [21, 5]], ellipsePath:false, closed:true}, '+ 'shape_0:{fillColor:[0, 0, 0], name:"", tag:"", strokeColor:null, pathPoints:[[22, 2], [21, 2], [21, 3], [22, 3]], ellipsePath:false, closed:true}, total:5}})'; var rgbModelSrc='({total:5, '+ 'shape_4:{fillColor:[1, 0, 0], name:"", tag:"", strokeColor:null, pathPoints:[[2, 2], [2, 9], [3, 9], [3, 3], [5, 3], [5, 5], [3, 5], [3, 7], [4, 7], [4, 6], [6, 6], [6, 2]], ellipsePath:false, closed:true}, '+ 'shape_3:{fillColor:[1, 0, 0], name:"", tag:"", strokeColor:null, pathPoints:[[5, 8], [5, 7], [4, 7], [4, 8]], ellipsePath:false, closed:true}, '+ 'shape_2:{fillColor:[1, 0, 0], name:"", tag:"", strokeColor:null, pathPoints:[[6, 9], [6, 8], [5, 8], [5, 9]], ellipsePath:false, closed:true}, '+ 'shape_1:{fillColor:[0, 1, 0], name:"", tag:"", strokeColor:null, pathPoints:[[7, 9], [11, 9], [11, 6], [9, 6], [9, 7], [10, 7], [10, 8], [8, 8], [8, 3], [10, 3], [10, 4], [11, 4], [11, 2], [7, 2]], ellipsePath:false, closed:true}, '+ 'shape_0:{fillColor:[0, 0, 1], name:"", tag:"", strokeColor:null, pathPoints:[[13, 5], [13, 3], [15, 3], [15, 5], [16, 5], [16, 2], [12, 2], [12, 9], [16, 9], [16, 6], [15, 6], [15, 8], [13, 8], [13, 6], [15, 6], [15, 5]], ellipsePath:false, closed:true}})'; var grayModelSrc='({total:7, '+ 'shape_6:{fillColor:[0.57, 0.58, 0.59], name:"", tag:"", strokeColor:null, pathPoints:[[7, 2], [7, 9], [8, 9], [8, 3], [10, 3], [10, 5], [8, 5], [8, 7], [9, 7], [9, 6], [11, 6], [11, 2]], ellipsePath:false, closed:true}, '+ 'shape_5:{fillColor:[0.57, 0.58, 0.59], name:"", tag:"", strokeColor:null, pathPoints:[[10, 8], [10, 7], [9, 7], [9, 8]], ellipsePath:false, closed:true}, '+ 'shape_4:{fillColor:[0.57, 0.58, 0.59], name:"", tag:"", strokeColor:null, pathPoints:[[11, 9], [11, 8], [10, 8], [10, 9]], ellipsePath:false, closed:true}, '+ 'shape_3:{fillColor:[0.82, 0.82, 0.83], name:"", tag:"", strokeColor:null, pathPoints:[[2, 9], [6, 9], [6, 6], [4, 6], [4, 7], [5, 7], [5, 8], [3, 8], [3, 3], [5, 3], [5, 4], [6, 4], [6, 2], [2, 2]], ellipsePath:false, closed:true}, '+ 'shape_2:{fillColor:[0.35, 0.36, 0.38], name:"", tag:"", strokeColor:null, pathPoints:[[15, 3], [13, 3], [13, 2], [15, 2]], ellipsePath:false, closed:true}, '+ 'shape_1:{fillColor:[0.35, 0.36, 0.38], name:"", tag:"", strokeColor:null, pathPoints:[[15, 3], [15, 5], [13, 5], [13, 3], [12, 3], [12, 9], [13, 9], [13, 6], [15, 6], [15, 9], [16, 9], [16, 3]], ellipsePath:false, closed:true}, '+ 'shape_0:{fillColor:[0.2, 0.22, 0.24], name:"", tag:"", strokeColor:null, pathPoints:[[21, 2], [21, 3], [20, 3], [20, 4], [19, 4], [19, 3], [18, 3], [18, 2], [17, 2], [17, 4], [18, 4], [18, 5], [19, 5], [19, 9], [20, 9], [20, 5], [21, 5], [21, 4], [22, 4], [22, 2]], ellipsePath:false, closed:true}})'; var noteMarkSrc='({total:4, '+ 'shape_3:{fillColor:[0.53, 0.33, 0.26], name:"", tag:"", strokeColor:[0.14, 0.12, 0.13], pathPoints:[[11, 21], [11, 14], [4, 14]], ellipsePath:false, closed:true, strokeWidth:1}, '+ 'shape_2:{fillColor:[1, 0.97, 0.62], name:"", tag:"", strokeColor:[0.14, 0.12, 0.13], pathPoints:[[11, 21], [1, 21], [1, 14], [7, 14], [11, 19]], ellipsePath:false, closed:true, strokeWidth:1}, '+ 'shape_1:{fillColor:null, name:"", tag:"", strokeColor:[0.14, 0.12, 0.13], pathPoints:[[1, 17], [6, 17]], ellipsePath:false, closed:false, strokeWidth:1}, '+ 'shape_0:{fillColor:null, name:"", tag:"", strokeColor:[0.14, 0.12, 0.13], pathPoints:[[1, 19], [6, 19]], ellipsePath:false, closed:false, strokeWidth:1}})'; var okBtnSrc='({total:2, '+ 'group_1:{'+ 'shape_5:{fillColor:null, name:"", tag:"", strokeColor:[0.39, 0.31, 0], pathPoints:[[11, 5], [5, 5], [5, 15], [11, 15]], ellipsePath:false, closed:false, strokeWidth:2}, '+ 'shape_4:{fillColor:null, name:"", tag:"", strokeColor:[0.39, 0.31, 0], pathPoints:[[28, 5], [22, 5], [22, 15], [28, 15]], ellipsePath:false, closed:true, strokeWidth:2}, '+ 'shape_3:{fillColor:null, name:"", tag:"", strokeColor:[0.39, 0.31, 0], pathPoints:[[14, 4], [14, 15], [19, 15]], ellipsePath:false, closed:false, strokeWidth:2}, '+ 'shape_2:{fillColor:null, name:"", tag:"", strokeColor:[0.39, 0.31, 0], pathPoints:[[45, 5], [40, 5], [40, 15], [45, 15]], ellipsePath:false, closed:false, strokeWidth:2}, '+ 'shape_1:{fillColor:null, name:"", tag:"", strokeColor:[0.39, 0.31, 0], pathPoints:[[40, 10], [43, 10]], ellipsePath:false, closed:false, strokeWidth:2}, '+ 'shape_0:{fillColor:null, name:"", tag:"", strokeColor:[0.39, 0.31, 0], pathPoints:[[31, 15], [36, 15], [36, 10], [32, 10], [32, 5], [37, 5]], ellipsePath:false, closed:false, strokeWidth:2}, total:6}, '+ 'group_0:{'+ 'shape_2:{fillColor:[0, 0, 0], name:"", tag:"", strokeColor:[0.57, 0.58, 0.59], pathPoints:[47, 2, 15, 15], ellipsePath:true, closed:true, strokeWidth:1}, '+ 'shape_1:{fillColor:null, name:"", tag:"", strokeColor:[0.93, 0.11, 0.14], pathPoints:[[51, 13], [58, 6]], ellipsePath:false, closed:false, strokeWidth:2}, '+ 'shape_0:{fillColor:null, name:"", tag:"", strokeColor:[0.93, 0.11, 0.14], pathPoints:[[58, 13], [51, 6]], ellipsePath:false, closed:false, strokeWidth:2}, total:3}})'; var addToDocBtnSrc='({total:5, '+ 'shape_4:{fillColor:[1, 1, 0.59], name:"", tag:"", strokeColor:[0.14, 0.12, 0.13], pathPoints:[[22, 16], [13, 16], [13, 9], [17, 5], [22, 5]], ellipsePath:false, closed:true, strokeWidth:2}, '+ 'shape_3:{fillColor:[0.14, 0.12, 0.13], name:"", tag:"", strokeColor:null, pathPoints:[[11, 13], [8, 13], [8, 4], [11, 4]], ellipsePath:false, closed:true}, '+ 'shape_2:{fillColor:[0.14, 0.12, 0.13], name:"", tag:"", strokeColor:null, pathPoints:[[5, 10], [5, 7], [14, 7], [14, 10]], ellipsePath:false, closed:true}, '+ 'shape_1:{fillColor:[1, 0, 0], name:"", tag:"", strokeColor:null, pathPoints:[[13, 9], [6, 9], [6, 8], [13, 8]], ellipsePath:false, closed:true}, '+ 'shape_0:{fillColor:[1, 0, 0], name:"", tag:"", strokeColor:null, pathPoints:[[10, 5], [10, 12], [9, 12], [9, 5]], ellipsePath:false, closed:true}})'; //===================================================Basic Functions========================// var UIElements=[Window,Group,EditText,Panel]; for(var i=0; i12){ hours-=12; return 'pm'; } else { if(hours==0){hours=1;} return 'am'; } }(); return (hours)+":"+minutes+":"+seconds+" "+ampm; } function getUIRGB(type, clr){ for(var x=0; x'; str = str.replace(/(\)/g, '<'+propNm+'>)/g,']]\>'+''); return XML(str); } function stringXmlSafe(str){ str=str.toString(); str=str.replace(/&(?!(amp;|gt;|lt;|quot;|apos;))/g,"&"); str=str.replace(//g,">"); str=str.replace(/'/g,"'"); str=str.replace(/"/g,"""); return str; } function getXmlSwatchesArr(xmlFile){ var myFile=xmlFile; myFile.open('r'); myFile.seek(0,0); var fileStr=myFile.read(); myFile.close(); var xmlObj=XML(fileStr); var swatchArr=[]; for(var x=0, ln=xmlObj.children().length(); x'); for(var i=0; i")); xmlBody.swatch[i].@order=i+1; xmlBody.swatch[i].appendChild(new XML(""+stringXmlSafe(thisSw.name)+"")); if(thisSw.name!='none'){ if(thisSw.info && thisSw.info.plating){ thisSw.aiSwatchKind=thisSw.info.plating; thisSw.colorComp.mode=thisSw.colorComp.typename; thisSw.originDoc=thisSw.info.originDoc; thisSw.notes=thisSw.info.notes; } xmlBody.swatch[i].appendChild(new XML(""+stringXmlSafe(thisSw.aiSwatchKind)+"")); xmlBody.swatch[i].appendChild(new XML("")); xmlBody.swatch[i].colorcomp[0].appendChild(new XML(""+stringXmlSafe(thisSw.colorComp.mode)+"")); xmlBody.swatch[i].colorcomp[0].appendChild(new XML("")); for(var j=0; j"+stringXmlSafe(thisSw.colorComp.comp[j])+"")); } xmlBody.swatch[i].notes=wrapCDATA(thisSw.notes, 'notes'); xmlBody.swatch[i].origindoc=stringXmlSafe(thisSw.originDoc); } } return xmlBody; } //===================================end XML=============// // gets type and color array from swatch in swatch palette - for BT function getAISwatchColor(processColorOrSpot,name){ function round2(num){ return Math.round(num*100)/100; } var result={type:null, name:null, colorArr:null, uiColor:null, plating:null, originDoc:null, creDt:null, rgbClr:null, cmykClr:null, grayClr:null, labClr:null}; var clr=processColorOrSpot; result.name=name; if(clr=="[RGBColor]"){ result.type="RGB"; result.colorArr=[round2(clr.red),round2(clr.green),round2(clr.blue)]; result.uiColor=[clr.red/255,clr.green/255,clr.blue/255]; result.plating='Process'; } else if(clr=="[CMYKColor]"){ result.type="CMYK"; result.colorArr=[round2(clr.cyan),round2(clr.magenta),round2(clr.yellow),round2(clr.black)]; result.uiColor=function(){ var newArr=convertAppColor("CMYK","RGB",[clr.cyan,clr.magenta,clr.yellow,clr.black]); return [newArr[0]/255,newArr[1]/255,newArr[2]/255,]; }(); result.plating='Process'; } else if(clr=="[GrayColor]"){ result.type="GRAY"; result.colorArr=[round2(clr.gray)]; result.uiColor=function(){ var newArr=convertAppColor("GrayScale","RGB",[clr.gray]); return [newArr[0]/255,newArr[1]/255,newArr[2]/255,]; }(); result.plating='Process'; } else if(clr=="[SpotColor]"){ clr=clr.spot; if(clr.colorType==ColorModel.SPOT){ result.plating='Spot'; } else if(clr.colorType==ColorModel.PROCESS){ result.plating='GlobalProcess'; } else if(clr.colorType==ColorModel.REGISTRATION){ result.plating='Registration'; } else { result.plating="Process"; } var intClr=clr.getInternalColor(); for(var i=0; i=0){ for(all in obj){ if(all.match(/\d{1,2}$/g) && all.match(/\d{1,2}$/g)==counter){ var thisShp=obj[all]; if(all.match('group')){ var ctr=obj[all].total; while(ctr>=0){ for(paths in obj[all]){ if(paths.match(/\d{1,2}$/g) && paths.match(/\d{1,2}$/g)==ctr){ drawPath(obj[all][paths], canvas); } } ctr--; } } else { drawPath(thisShp, canvas); } } } counter-=1; } } function btnSkin(elem,aClr,w,h){ var g=elem.graphics; var brush=g.newBrush(g.BrushType.SOLID_COLOR,aClr); g.newPath(); g.moveTo(1,1); g.lineTo(w-1,1); g.lineTo(w-1,h-1); g.lineTo(1,h-1); g.closePath(); g.fillPath(brush); var ltr=[aClr[0]*1.2,aClr[1]*1.2,aClr[2]*1.2]; for(var c=0; c1){ ltr[c]=1; } } brush=g.newBrush(g.BrushType.SOLID_COLOR,ltr); g.newPath(); g.rectPath(0,0,w,h/2); g.fillPath(brush); var pen=g.newPen(g.PenType.SOLID_COLOR,[1,1,1,1],2); g.newPath(); g.moveTo(1,1); g.lineTo(w-1,1); g.lineTo(w-1,h-1); g.lineTo(1,h-1); g.closePath(); g.strokePath(pen); } function createAltDisp(swObj, uiParent){ var altClrs=swObj.info.altClrs; var modes=['CMYK','RGB','LAB','GRAY']; for(var m=0; m1){ return "--Multiple Selection--"; } }(); var w=new Window('dialog',"Swatch Info & Preferences"); w.margins=[4,4,4,4]; var g_0=w.add('group'); g_0.orientation='column'; g_0.spacing=4; var g_0_1=g_0.add("group"); if(swatchBox!=null){ if(swatchBox=="--Multiple Selection--"){ // Multi var msg=g_0_1.add('statictext',undefined,swatchBox); } else { //Single if(swatchBox.name!='none'){ noteChange=swatchBox.noteChange; swatchInfoBox(swatchBox, g_0_1); } else { var msg=g_0_1.add('statictext',undefined,"Empty Cell"); } } } else { // NONE //var msg=g_0_1.add('statictext',undefined,"NONE"); } var g_0_1=g_0.add("panel",undefined,"Main Window Prefrences"); g_0_1.size=[340,44]; g_0_1.orientation='column'; var boxGrp=g_0_1.add('group'); var modelBx=boxGrp.add('checkbox',undefined,"Show Color Mode"); modelBx.value=SESSION.options.showMode; var noteBx=boxGrp.add('checkbox',undefined,"Show Note Marker"); noteBx.value=SESSION.options.showNotes; var g_0_2=g_0.add("panel",undefined,"Persistence Options"); g_0_2.size=[340,54]; var saveBtn=g_0_2.add('button',undefined,"Save Current Session"); var okBtn=w.add('button',undefined,'Ok'); okBtn.size=[340,20]; okBtn.margins=[0,0,0,0]; okBtn.onClick=function(){ w.close(); } saveBtn.onClick=function(){ var swcs=SESSION.swatchBoxes, swcsLn=SESSION.swatchBoxes.length; var dir=SESSION.presetFolder; var saveFl=File(dir+"/HoboSwatchSession.xml"); var blank=function(){ for(var s=0; s\r'+getXmlSwatchesXML(swcs)); saveFl.close(); if(saveFl.exists){ alert("Successfully Saved in: "+decodeURI(saveFl),'SUCCESS!'); } else { alert("Sorry, "+decodeURI(saveFl)+"'s save operation was NOT successful!",'Failure... Horrible abysmal failure. :\'('); } } } w.show(); userChoice.showMode=modelBx.value; userChoice.showNotes=noteBx.value; userChoice.noteChange=function(){ if(swatchBox!=null && (swatchBox.noteChange != noteChange)){ return true; } return false; }(); return userChoice; } //===================================================For Bridge Talk========================// function asSourceString(func, withArgs){ if(withArgs!=undefined && withArgs==true){ return func.toSource().toString().replace("(","").replace(/\)$/,""); } else { return func.toSource().toString().replace("(function "+func.name+"(){","").replace(/}\)$/,""); } } function sendBTmsg(func, updateObj, resultFunc, resultFuncArgs){ if(updateObj==undefined){updateObj={self: 'nothing'}}; var updateObjName=updateObj.self; if(updateObjName!=undefined){ var bt=new BridgeTalk; bt.target='illustrator'; var btMsg=asSourceString(func); for(all in updateObj){ if(all!='self'){ var rx=new RegExp(updateObjName+'\\.'+all,'g'); btMsg=btMsg.replace(rx,updateObj[all]); } } bt.body=btMsg; //$.write(btMsg); if(resultFunc!=undefined){ bt.onResult=function(result){ resultFunc(result.body, resultFuncArgs); } } bt.send(); } else { $.writeln("Error, function 'sendBTmsg(func, updateOb)': the update object should have a 'self' property, indentifying its' name."); } } function doNothing(){ var nothing=function(){ return; }() } function initSwatch(SESSION, sw, name, mode, clrArr, uiClr, info){ // Result of getting document swatches. sw.fillColor=uiClr; sw.name=name; if(mode=="RGB" || mode=="LAB"){ sw.colorComp={typename:ColorComp[mode].typename,comp:[clrArr[0],clrArr[1],clrArr[2]]}; } else if(mode=="CMYK"){ sw.colorComp={typename:ColorComp[mode].typename,comp:[clrArr[0],clrArr[1],clrArr[2],clrArr[3]]}; } else if(mode=="GRAY"){ sw.colorComp={typename:ColorComp[mode].typename,comp:[clrArr[0]]}; } sw.colorComp.name=sw.name; SESSION.nameDisplay.text=sw.name; sw.info=info; sw.addDrawPhase(sw.coloredState); if(info.plating=="Spot"){ sw.addDrawPhase(sw.spotMark); } else if(info.plating=="GlobalProcess"){ sw.addDrawPhase(sw.globalMark); } if(SESSION.options.showMode==true){ sw.addDrawPhase(sw[mode+'Model']); } if(SESSION.options.showNotes==true && sw.info && sw.info.notes!=''){ sw.addDrawPhase(sw.noteMark); } if(sw.selected==true){ sw.removeDrawPhase(sw.selectedMark); sw.addDrawPhase(sw.selectedMark); } sw.refresh(); sw.instantiated=true; sw.elem.helpTip=sw.getInfo(); } //=========<<<<<<<<<<<<<<0){ var doc=app.activeDocument; var swcs=doc.swatches.getSelected(); if(swcs.length>0){ BTOBJ.func_convertAppColor; BTOBJ.func_currentTime; BTOBJ.func_getAISwatchColor; for(var s=0; s0){ var doc=app.activeDocument; var swcs=eval(BTOBJ.sessionSelection); var nonConflictingSwatches=[]; for(var s=0; s0){ var swG=doc.swatchGroups.add(); var d=new Date(); swG.name="Added at "+((d.getMonth()+1)+"/"+d.getDate()+"/"+d.getFullYear()+" "+currentTime()); } for(var s=0; s-1; x--){ if(this.currentDrawingState[x].id==oldPhase.id){ this.currentDrawingState.splice(x,1); } } } this.currentDrawingState=[this.noneState]; this.assignOnDraw=function(aDrawings){ this.elem.onDraw=function(){ for(var d=0; d SESSION.lastSelection.uiOrder){ var indA = SESSION.lastSelection.uiOrder, indB = ev.target.parentObj.uiOrder; } else { var indA = ev.target.parentObj.uiOrder, indB = SESSION.lastSelection.uiOrder; } for(var s=0; sindA && s1){ nameD.text="--Multi-Selection: "+SESSION.selection.length+"--"; SESSION.lastSelection=SESSION.selection[0]; } else if(SESSION.selection.length==1){ nameD.text=SESSION.selection[0].name; SESSION.lastSelection=SESSION.selection[0]; } else if(SESSION.selection.length==0){ nameD.text=''; SESSION.lastSelection=null; } }); allSwatchBoxes.push(thisSwatch); } var g_0_1_scrl=g_0_1.add('scrollbar'); g_0_1_scrl.size=[10,152]; var g_0_2=g_0.add('group'); g_0_2.indent=1; var nameD=g_0_2.add('edittext',undefined,'',{readonly:true}); nameD.size=[140,20]; nameD.setBg([1,1,1]); SESSION.nameDisplay=nameD; var btnG=g_0.add('group'); btnG.margins=[1,1,1,1]; btnG.spacing=2; var infoBtn=btnG.add('button',undefined,'I'); infoBtn.size=[26,20]; infoBtn.helpTip='Get swatch info'; infoBtn.onDraw=function(){ btnSkin(this,[0.9,0.8,0.3],26,20); drawImg(infoBtnSrc, this); } var addToDocBtn=btnG.add('button',undefined,'T'); addToDocBtn.size=[26,20]; addToDocBtn.helpTip='Add selected swatches to current document'; addToDocBtn.onDraw=function(){ btnSkin(this,[0.3,0.8,0.9],26,20); drawImg (addToDocBtnSrc, this) } var addBtn=btnG.add('button',undefined,'A'); addBtn.size=[26,20]; addBtn.helpTip='Add swatch from current document to this palette'; addBtn.onDraw=function(){ btnSkin(this,[0.4,0.8,0.4],26,20); drawImg(addBtnSrc, this); } var rmvBtn=btnG.add('button',undefined,'R'); rmvBtn.size=[26,20]; rmvBtn.helpTip='Remove current selected swatch from this palette'; rmvBtn.onDraw=function(){ btnSkin(this,[0.6,0.2,0.3],26,20); drawImg(rmvBtnSrc, this); } var btnG_2=g_0.add('group'); btnG_2.margins=[1,1,1,1]; btnG_2.spacing=2; var rstBtn=btnG_2.add('button',undefined,'Reset'); rstBtn.size=[65,20]; rstBtn.helpTip='RESET all Hobo Swatches to "none"'; rstBtn.onDraw=function(){ btnSkin(this,[1,0.6,0.2],65,20); drawImg(rstBtnSrc,this); } var okBtn=btnG_2.add('button',undefined,'Close'); okBtn.size=[65,20]; okBtn.helpTip='Close this palette'; okBtn.onDraw=function(){ btnSkin(this,[0.8,0.2,0.2],65,20); drawImg(okBtnSrc,this); } g_0_1_scrl.onChange=function(){ // Need both of them for mousewheels and clicks. swatchContainer.location=[0,1-(this.value/100*96)]; } g_0_1_scrl.onChanging=function(){ swatchContainer.location=[0,1-(this.value/100*96)]; } addBtn.onClick=function(){ if(SESSION.selection.length>0){ sendBTmsg(bt_func, BTOBJ, bt_func_rt, [SESSION]); SESSION.nameDisplay.text=SESSION.selection[0].name; } else { alert("Please allocate cells to fill with your document swatches."); } } rmvBtn.onClick=function(){ if(SESSION.selection.length>0){ if(SESSION.selection.length<2){ var sw=SESSION.selection[0]; sw.reset(); sw.selected=true; sw.addDrawPhase(sw.selectedMark); sw.refresh; nameD.text=sw.name; sw.elem.helpTip=sw.name; } else { for(var s=SESSION.selection.length-1; s>-1; s--){ var sw=SESSION.selection[s]; sw.reset(); sw.selected=true; sw.addDrawPhase(sw.selectedMark); sw.refresh; sw.elem.helpTip=sw.name; } nameD.text=sw.name; } } } infoBtn.onClick=function(){ var sessionUpdate=infoWindow(SESSION); if(sessionUpdate.showMode!=SESSION.options.showMode || sessionUpdate.showNotes != SESSION.options.showNotes || sessionUpdate.noteChange==true){ SESSION.options.showMode=sessionUpdate.showMode; SESSION.options.showNotes=sessionUpdate.showNotes; for(var s=allSwatchBoxes.length-1; s>-1; s--){ var thisBox=allSwatchBoxes[s]; var dState=thisBox.currentDrawingState; if(SESSION.options.showMode==false){ for(var c=dState.length-1; c>-1; c--){ if(dState[c].id.match('model')){ thisBox.removeDrawPhase(dState[c]); } } } else { for(var c=dState.length-1; c>-1; c--){ if(dState[c].id.match('model')){ thisBox.removeDrawPhase(dState[c]); } } if(thisBox.colorComp.typename!="NULL"){ thisBox.addDrawPhase(thisBox[thisBox.colorComp.typename+"Model"]); } } if(thisBox.info && thisBox.info.hasOwnProperty('notes')){ if(SESSION.options.showNotes==false || thisBox.info.notes==''){ for(var c=dState.length-1; c>-1; c--){ if(dState[c].id=='notes'){ thisBox.removeDrawPhase(dState[c]); } } } else if(SESSION.options.showNotes==true && thisBox.info.notes!=''){ for(var c=dState.length-1; c>-1; c--){ if(dState[c].id=='notes'){ break; } else if(dState[c].id!='notes' && c==0){ thisBox.addDrawPhase(thisBox.noteMark); } } } } thisBox.refresh(); } } } rstBtn.onClick=function(){ if(confirm('Are you sure you want to reset the whole Hobo Swatch palette?',true,'Confirm this action:')==true){ for(var i=0; i0){ BTOBJ.sessionSelection=function(){ var arr=[]; for(var s=0; s\x00\x00\x00\x0EIDATx\u00DAb`\x18Y\x00 "+ 37 | "\u00C0\x00\x00\u00F0\x00\x01\u00A7\x02\u00EC\x02\x00\x00\x00\x00IEND\u00AEB`\u0082"), 38 | square_yellow : ScriptUI.newImage("\u0089PNG\r\n\x1A\n\x00\x00\x00\rIHDR\x00\x00\x00\x0F\x00\x00\x00\x0F\b\x03\x00\x00\x00\f\bex\x00\x00\x00\x19tEXtSoftware\x00Adobe "+ 39 | "ImageReadyq\u00C9e<\x00\x00\x00\x06PLTE\u00FF\u00FF\x00\x00\x00\x00\u008B\u00C7\u00D5\u008F\x00\x00\x00\x0EIDATx\u00DAb`\x18Y\x00 "+ 40 | "\u00C0\x00\x00\u00F0\x00\x01\u00A7\x02\u00EC\x02\x00\x00\x00\x00IEND\u00AEB`\u0082"), 41 | square_purple : ScriptUI.newImage("\u0089PNG\r\n\x1A\n\x00\x00\x00\rIHDR\x00\x00\x00\x0F\x00\x00\x00\x0F\b\x03\x00\x00\x00\f\bex\x00\x00\x00\x19tEXtSoftware\x00Adobe "+ 42 | "ImageReadyq\u00C9e<\x00\x00\x00\x06PLTE\u00FF\x00\u00FF\x00\x00\x00\u009F\u00A6\x14\u00F2\x00\x00\x00\x0EIDATx\u00DAb`\x18Y\x00 "+ 43 | "\u00C0\x00\x00\u00F0\x00\x01\u00A7\x02\u00EC\x02\x00\x00\x00\x00IEND\u00AEB`\u0082"), 44 | square_green : ScriptUI.newImage("\u0089PNG\r\n\x1A\n\x00\x00\x00\rIHDR\x00\x00\x00\x0F\x00\x00\x00\x0F\b\x03\x00\x00\x00\f\bex\x00\x00\x00\x19tEXtSoftware\x00Adobe "+ 45 | "ImageReadyq\u00C9e<\x00\x00\x00\x06PLTE\x00\u00FF\x00\x00\x00\x00o\x03~C\x00\x00\x00\x0EIDATx\u00DAb`\x18Y\x00 "+ 46 | "\u00C0\x00\x00\u00F0\x00\x01\u00A7\x02\u00EC\x02\x00\x00\x00\x00IEND\u00AEB`\u0082"), 47 | cog : ScriptUI.newImage("\u0089PNG\r\n\x1A\n\x00\x00\x00\rIHDR\x00\x00\x00\x0F\x00\x00\x00\x0F\b\x03\x00\x00\x00\f\bex\x00\x00\x00\x19tEXtSoftware\x00Adobe ImageReadyq"+ 48 | "\u00C9e<\x00\x00\x00\u0081PLTE\u00B0\u00B0\u00B1\u00BB\u00BB\u00BC\u00D2\u00D2\u00D3\u008F\u008F\u0091CBDddfffhnoqeegimndhhhmm]]_]\\^\u00CE\u00CD\u00CE\u008F"+ 49 | "\u0090\u0092LJLdce\u00D6\u00D6\u00D7xwy:8:JHJXWYTRTkjkB@AoorNNQ\u00D9\u00DA\u00DA\u00D1\u00D0"+ 50 | "\u00D1MLM\u0082\u0082\u0084^]_oprjooKJKfkkZ[]SQSxxz\u00F4\u00F4\u00F4KKN\u00FF\u00FF\u00FFXd6\x1F\x00\x00\x00+tRNS\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF"+ 51 | "\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF"+ 52 | "\u00FF\u00FF\u00FF\u00FF\u00FF\x00#\u00C9\u00A7\u00D0\x00\x00\x00oIDATx\u00DAb\u00D0B\x05\f\x10J\u0083I\x03\u0085\u00CF\u00A0\u00C9\u0088\u00E03\u00AB\x0B\u00C9K\x0B\u00CB\u00AA3C\u00F9\u00EA\u009A\x1C\u00BCb\u00E2,\u009A\u00EAP\u00BE\f\u00BB\u0080\x1C\u008F"+ 53 | " \u00AB\b\x1F\u0098\u00AF\u00C1\u00C8\u00CF&\u00C9\u00A5\u00C2)%*\u00C1\u00A0\x01\u00E43i\u00AA*(skr+\u00AA\u00B1h2\u0081\u00E4\x19@\u00F2J yF\r,\u00FA1\u00CDG\u00B7\x1F\b\x185\x19\u00F0\u00BA\x1F\x0E\x00\x02\f\x00]\x05\x1C\x7F\u00C6r\u00F1\u008A\x00\x00\x00\x00IEND\u00AEB`\u0082"), 54 | adobe_ae : ScriptUI.newImage("\u0089PNG\r\n\x1A\n\x00\x00\x00\rIHDR\x00\x00\x00\x0F\x00\x00\x00\x0F\b\x06\x00\x00\x00;\u00D6\u0095J\x00\x00\x00\x19tEXtSoftware\x00Adobe ImageReadyq"+ 55 | "\u00C9e<\x00\x00\x01\x01IDATx\u00DAblfx\u00EA\u00C0\u00C0\u00C0\u00B0\u009F\u0081\f\u00C0\u00C4@\x01\u00A0\u00AE\u00E6\u00E7\fW\x19Z\x194\x19\u00CE3\u00AC\"]\u00F3\x03\u0086"+ 56 | "\u00E3@\u00AD\x1E\f\u00D7\x19v\u0092\u00AE\x19d\u00A3%C\n\u00C3}\u0086c\f?\x18>\u00C1\u00C5A\u00EC\u00FD\f}\f\u00F3\x18B\u0080\x06\u00EF\u00C0\u00D4\u00FC\u0081\u00E11\u00C3w"+ 57 | "\u00A0\"I\x06m\u00A8\u00ED;\u00E0r\u00CB\x18\u0092\x188\x18\u00F8\x18\u00A2\u0080\u00DA\u00CF3\u00AC\x06[\u0082\u00A2\x19\u00E4TM\x06w0[\x11h?\u00CC\u00E9 [\u00DF3"+ 63 | "Y\u008E\u0081h\u00C0\u00C4@\n\u00A0L\u00F5\u00C3w\x7F.=\u00F9\u0085,\u00F2\u00F1\u00FB?\u009C\u00AA\u00D3\u0096"+ 64 | "\u00BCK]\u00FA\x0E\u00CE]|\u00F2k\u00EA\u0092\u00B7\u00D8U\x03\u008Dy\u00F8\u00F6\u008F\u00BE4\u00EB\u00E6K\u00DF!"+ 65 | "\"\u00B1\u00E6\u00DC\u00ABRE\u00B1\u00AB\u00DEt\u00E9\u00BB\u009D*\u00BB\u00AD*\u00C7\u00E6K\u00DF "+ 66 | "\"\u0087n\u00FFt\u009F\u00F4\n\u00BBj\u00A0\"_=.?=\u00CEM0\u00B3q\u00FA\x12\u00E8\f\u00A0\x03\u00F89\u0099.>"+ 67 | "\u00F9-\u00C0\u00C9\u00B4\x19\u009B\x06&Tgp\x1C\u00BE\u00F3\x03\u0088\u00F4dX\u00E1\u008EA\x06,\u00C8\u00CE\u00C8q\u00E0\u00F5\u00D5"+ 68 | "\u00E3\u0084\u0084\u00A3y\u00C7\u008BY\u00B8\u00CC\x06:\x03\u00E8!\u0088R \u0090\x17b\u0091\x17f\u00C1t\f\u00E3\u00A0I'\x00\x01\x06\x00F"+ 69 | "\u00ADU\u00C4I\x19{m\x00\x00\x00\x00IEND\u00AEB`\u0082"), 70 | adobe_id : ScriptUI.newImage("\u0089PNG\r\n\x1A\n\x00\x00\x00\rIHDR\x00\x00\x00\x0F\x00\x00\x00\x0F\b\x02\x00\x00\x00\u00B4"+ 71 | "\u00B4\x02\x1D\x00\x00\x00\x19tEXtSoftware\x00Adobe ImageReadyq\u00C9e<\x00\x00\x00\u008CIDATx"+ 72 | "\u00DAb\u00DC\u00AAp\u0084\u0081h\u00C0\u00C4@\n\u00A0@\u00F5\u00BD_\u00B7\u00BF\u00FE\u00FB"+ 73 | "\u0082&2\u00EB\u00DD$\u00EC\u00AA\u0081\x12@id\x11\u00A0fd\x11\u00D2\\\u00C2\u0082Ut\u00CF\u0097"+ 74 | "\u00ED\x1B?\u00AD\u00E2f\u00E2\x11g\u0091$\u00A0\u00FA\u00E5\u009F\x17\u00CB>\u00CC\u009B,5\x1F\u00A8"+ 75 | "\x1A\u00C8x\u00F9\u00E79>\u0097\u00EC\u00FD\u00B2\u00CD\u0085\u00C7\x13\u00A8\x14\u00C8\u00D6\u00E50$"+ 76 | "\x10\u0082\x10u\u00C4\u00867\u00D0<\u00A0\u00BB!Ay\u00F9\u00C7y\x02\u00EEVbS\u008D\x12H\u00AAx\u0091+"+ 77 | "\u00CE\"\u0081\u00E6\x12\u00C6A\u0093N\x00\x02\f\x00\x15\x057\u00EF\u00BAg\u00E5\u00E0\x00\x00\x00\x00IEND\u00AEB`\u0082"), 78 | adobe_ps : ScriptUI.newImage("\u0089PNG\r\n\x1A\n\x00\x00\x00\rIHDR\x00\x00\x00\x0F\x00\x00\x00\x0F\b\x02\x00\x00\x00\u00B4"+ 79 | "\u00B4\x02\x1D\x00\x00\x00\x19tEXtSoftware\x00Adobe ImageReadyq\u00C9e<\x00\x00\x00\u00C9IDATx"+ 80 | "\u00DAb\u0094L\u00FD\u00CF@4`b \x05\u0090\u00A6\u009A\x05\u00CE\u00FA\u00F7\u00EB\u00C3\u009F"+ 81 | "\u00B7\x17\x18\u00D9\x04X\u0085\rp\u00A9f\u00E65n\u0080\u00B0\u00DEm\u00F7\u00FC\u00FB\u00E5\u00E1"+ 82 | "\u00FF\u00EF/?\x1D/dd\u00E6\u00C0\u00AA\u0087\x05\u0099\u00C3\u00A5\x16\u00CF&\u00E9\u00C0\u00A9\x1A"+ 83 | "\u00FFv\u00AB#\u00A7Z\x02\x01\u00D50\u00EB\x14\u00FE~~\x00d|\u00BF\u00B5\u00E0\u00DB\u00AD\u0085@\u0086"+ 84 | "\u0080\u00FD|\u00A0 v\u00D5\x1F\x0E&B\f\x06:I4\u00F2>\x13\u009B\x00\u00F60\x01J\u00BF\u00DF\x1D\u00C8*\u00AC"+ 85 | "\u00CFg\u00D9\x0F\u00E4\u00B2+\x04\u00BC\u00DF\x15\u00F8\u00EB\u00F9\x01\u00EC.\x01*\x02\u00BA\x1B\u00CE\x05:"+ 86 | "\x00\u00E8\x18\u00A0\x06A\u00B7\u00F5\x10q|\u00E1\r\fS\u00A0\u0093\u0080\u00E8\u00F7\u00DB\x0B8}\tW\n4\x15d\x1E"+ 87 | "\u00BB\x00\u008Fq=D\u0090q\u00D0\u00A4\x13\u0080\x00\x03\x00J*E\u00DC\u00E3\u00CD\x1A\x0F\x00\x00\x00\x00IEND\u00AEB`\u0082"), 88 | adobe_br : ScriptUI.newImage("\u0089PNG\r\n\x1A\n\x00\x00\x00\rIHDR\x00\x00\x00\x0F\x00\x00\x00\x0F\b\x03"+ 89 | "\x00\x00\x00\f\bex\x00\x00\x00\x19tEXtSoftware\x00Adobe ImageReadyq\u00C9e<\x00\x00\x000PLTE.&\x00\u00B9\u0099\x00lY\x00>3\x00\x1F"+ 90 | "\x1A\x00\u00E8\u00BF\x00M@\x00\u008Bs\x00\u00AA\u008C\x00\u009A\u0080\x00]M\x00\u00D8\u00B3\x00\u00C9\u00A6\x00|f\x00\x00\x00\x00\u00F7"+ 91 | "\u00CC\x00\t\u00A94\u00A5\x00\x00\x00KIDATx\u00DA\u0094\u00CE;\x0E\u00C00\b\x03P\x03M\u00D2\x1F"+ 92 | "\u00F5\u00FDo\u009B4C\x04[\u008B\u0084\u00D0\u0093=\x00\u00E6\u00C1\x07_\"\u00C9\u008F\u00EB&\u00D1\u00E4^\u00B3"+ 93 | "\u009B\u00D2\u00DB[\u009A6\u008C\u00E3(+/z\u00D2=\u00F4\u00C7&\x1F\u00886\u00ABw\u00F0\u009F\u00FF\u00BB"+ 94 | "\x00\x03\x00\u0094\r\x0B\u00ED|\u0091\u00A5\u00BE\x00\x00\x00\x00IEND\u00AEB`\u0082"), 95 | script_gray : ScriptUI.newImage("\u0089PNG\r\n\x1A\n\x00\x00\x00\rIHDR\x00\x00\x00\x0F\x00\x00\x00\x0F\b\x06\x00\x00\x00;\u00D6\u0095J"+ 96 | "\x00\x00\x00\x19tEXtSoftware\x00Adobe ImageReadyq\u00C9e<\x00\x00\x01\u009AIDATx\u00DA\u00B4R=k\u00C2P\x14"+ 97 | "\u00BD6E\"\u00A8d\u00D0A\x17\x1F\u00B8TAq\x112(\u00CD\x14\x17\u0087v\u0091\u008E\u0099\u00A4\u00DD\u00DA\u00BF\u00E0\x1Fh\u00FFA\u00AA"+ 98 | "\u0083\u008BC\u00E9\u0098Al\x17\x07\x15\x04\x17G\x03\n\u008A(\u00A4\u00A0\u0088\x1F\u00F0z\u009FUy\u00D5\u0094"+ 99 | "\x0E\u00A5\x07.\u008Fw^\x0E\u00F7\u009C{\x03\u00F0\x078l8\r\u008B\u00D8\u00F0\x16\u00D6\u00F3\u00EE\u00DC\u00E2\u009C\x7Fu\u00B9"+ 100 | "\\\u00B5t:\u00AD\x04\u0083A\u00A8\u00D7\u00EBP.\u0097\x0Fo\u00C3\u00E1\x104M\u00BB\u009CN\u00A7\u00D7{\u00EE"+ 101 | "\u008C\x17G\u00A3Q\u0085\x10\x02N\u00A7\x13<\x1E\u00CFV\u00B0\u0087\u00DB\u00ED\x06|\u0093\u00F8\u00EF\u00BFu^\u00ADV_Y\x1C\x0E\x10"+ 102 | "\x04\x01t]\u0087f\u00B3\t\u00FD~\u00FF\t\u00E9\u008F\u009D\u00ED\x03\x04\u00FE2\u009B\u00CDH$\x12I\u00F8|>"+ 103 | "\u00C0\x13B\u00A1\x10\u00C4b1h\u00B7\u00DB\u00A3\u00E5ry\u00C7\u00E7=\x11"+ 104 | "\u00AF\u00D7\u00EB\u00F7\u00F1x|\u009BJ\u00A5D\u00BF\u00DF\x0F\u0092$A \x10\u0080d2y\u0081\x0E\u00C8b\u00B1x\u00FDm\u00DA\t\u00CCV+\x14\n\x12s\u0080C"+ 105 | "\x04Q\x14\u0099u\u00C8\u00E5r\u00CC\u00FE\u0083m\u00E7\x1DF\u0096e\x19\u009B\u00CD\u00E6&\u009B"+ 106 | "\u00CD\u008A\u00AC;\u00ABp8\f\u00F3\u00F9\\n\u00B5Z\u00C5c\u00FBv\u00B8\u00AFT*t2\u0099P\x14Q\u008CD\u00AB"+ 107 | "\u00D5*E^\u00F9Ip\u0085+\u00D2\u00E3\u00F1xOQ\x14\u009A\u00CF\u00E7):\u00A0\u0098\u0095\u00E2\u00DAh&\u0093\u00A1\u00FC\x0F\u00C4\u00AF"+ 108 | "\u008A\u00A0\u00E0\x05\u00EB@4\x1A\r\u00E8v\u00BB`\x18\x06\u0094J%\u00AB\u00D3\u00E9\u00B0\u00BC\u00A6\u009DXb\u00D9\u00F60M\x13\x06\u0083"+ 109 | "\x01\u00A8\u00AA\u00FA\u0086]\u008B\u00C7;>\u0081\u00D7\u00EB}"+ 110 | "\u0094e\u0099\u00B2\u00C2\u00AB\u00CE&\x0F\u00FF\u0085O\x01\x06\x00\u00B2\u00AB\u009C\x1D/E\u00AC\u0096\x00\x00\x00\x00IEND\u00AEB`\u0082"), 111 | script_ice : ScriptUI.newImage("\u0089PNG\r\n\x1A\n\x00\x00\x00\rIHDR\x00\x00\x00\x0F\x00\x00\x00\x0F\b\x06\x00\x00\x00;\u00D6\u0095J\x00\x00"+ 112 | "\x00\x19tEXtSoftware\x00Adobe ImageReadyq\u00C9e<\x00\x00\x01\u00A5IDATx\u00DAb`\u00A0\x000b\x11S\x00\u00E2\x00 \x16"+ 113 | "\u00C0\"\u00F7\x00\u0088\x17\u00C08,\u00E8\x1A\u00A5M\u00CD\u00CF\u00DBV\u00D5\x0B\u00FC\u00FA\u00F2\u0099\u00E1\u00D7\u0092"+ 114 | "\u00F5\fy!\u0085p\u00C9]\u00C7\u00B62\u00F4\u00CCob\u0080\x19\u0080\u00AE9\x00\u00A4\u0091WR\n\u00CCy,\u00C4"+ 115 | "\u0087\"\u00A9\u00AFn\x04s\x19V\u009B\x1F\u00BC\u00BD}\u0093\x01\u00A4\u00F97\u00D0\u00E6\u00E7\x1F^2L90\u009Fa\u00F7\u00E6e\x1F"+ 116 | "\u00BE\x7F\u00FA4\x11(\u00FF\x01\u00D9\u00D9\u00E8~\x16\u0090\u00B3\u00B49\x1F\u00F5P^A!\u00C0\u00C0\u00C0\x00\u00AC\x19\u0084\u00DD}\u00FD\x18"+ 120 | "\u00DE~\u00FE"+ 121 | "\u00FF\u00E0\u00CB\u00B7\u00FF/\u00BF\u00FF\u00F8\u00AF\u00A6\u00AE~\u009E"+ 122 | "\u00A8D $\"\u00B2\u00FF\u00C6\u00F3\x17\u00FF\u00DF\u00FF\u00FC\u00F5\u00FF\u00FB\u009F\u00BF\u00FF\u00FF\u00FC\u00FB\u00F7\u00BF\u00AE\u00AE\u00EE?\u00AE\u00D0\x06\u0081"+ 123 | "\x021qE\x7F9E=\x03VVv\u0081\u00AB\u00C7\u008F1\u00A8\u00F8\u00F91\u00FC\u00F8\u00F1\u009D\u00E1\u00DE"+ 124 | "\u00C3\u0087\f+V\u00AC8\u0080+\u00B4\x13\u00922\u00A6\u00CCWT6\x04s\u00EE\u00DF=\u00CF\u00A0\u00AD\u00FA"+ 125 | "\u0093\u00C1\u00D8\u00D8\u0098a\u00D3\u00A6M\f\u00ABV\u00AD:\u00F0\u00E4\u00C9\u0093BX\u00A0a\u00A40I)U8"+ 126 | "\u00E7\u00FC\u0099m\f\u00E7N\u00EA\r\u00AF\u0098q5Q!\u0084+HT4H\u00E8PIY\r\u00EAV\x7F\u00A0\u00FA\r\u00AD\u00814JK\x05\u00ADBCD55%M"+ 150 | "\x06.\u0081C\u00B6H`\u00E1\u008D\u00CC%\u00E1*It\u00FDzz/\x1A\u0088\u00F91D\x07\x1E\u00DE\u00F7\u009C\u00F7<\u00E7\u00BC"+ 151 | "\u00E7\u0083\u00E8\x0F\u00A2\u00E9a\x0B\u00B4\u00D1KN\x18\u00A4~\u00C1\x0E\u0096\u00C4=l\u00F9\u0093p\u00BA\u00FC\u00C8"+ 152 | "\u00E5\b@\x0B\u00B2L\b\u0087)\u00D7\u00E9\u00CCu*\x13\x13\u00F3\x1E\u00E3\u00AA\u008D\u009E\x1C\u00D7\u00A4/\u008D\u0091\u00C4r"+ 153 | "\u0088b\u00EBM\x10\u0088\u00ECv\x12\u00FB\u0092\u00CB\u00BCD\u00CF\u008B7\u00F4i~\u00A7\u00F2\u009DD;g:\u0092\u00F7"+ 154 | "\u009B$\u00C5q\u00C5\u009E\x1F\x18n\x07\u00F5`\u00DBxl\u0087!m\x01\u00F7h\u0080"+ 155 | "\u00F6\u0099\u0083>\u00C7C\u00EF\u00D5\u00DF\u00AB\u00C9\u0087\u00B7\u00D0"+ 156 | "\u00A2Ip\u00C9\x11\b/\x02\\\u00AF.x\x0B^\x04R\x01\u00F0\x16\u00FEW\u0080^\u00DD\x16x\x1F\u009F\u00F0\u009D\u00FA<"+ 157 | "\x0E\u00B3\u0083\u00C6\u00B5\u00E3d\u00D5Y\u00C9\u00F8a\u00A4\u00E8\\\u00F4\u00B6\\,"+ 158 | "\u00AF\u00FC8\u00EAz\u0090\u00BF\u00EA\u0085\u00FAE-U\x0B\u00857\u00C2\u008E)\u00D3\x14\u00B997\u00A9\u00E7\u00CC\u00E4\u008C"+ 159 | "\x18\u00BF\u008C\u00AB\u00B5?\x0E+ \u00B0\u00B9\u00BB\u0089\u00B4\u0092F\u00BE\u009EG"+ 160 | "\u00A5QA\u00ADQ\x03\u00B3\u00EF\u00F5#x\u00D4Y\x13\u00CD\u00B2\u00FABp"+ 161 | "\u008A+\u00A86\u00ABP\x14\x05\u00C5b\x11\u0091H\x04\x03\x16h\u009A-\u00C1!~`2\u00AD!"+ 162 | "\u009B\u00CD\"\x16\u008B!\x18\f\u00CA\u00DDY\u00BB\x1A\u00B6\u00CCH\x1B\u00ED\u00FB\x1BY\u00AD\u00E7d\u00B3\u0099\u00A4L&s"+ 163 | "\u00D4^\u00CD\u00D2\u00C09\x13-\u00C8\u00EA\u0097\u0089F\x13L_\u00A7\u00FF\u0092o\x01\x06\x00"+ 164 | "\u009B\f\u009B\u00C5\nI\u00AB\u00A0\x00\x00\x00\x00IEND\u00AEB`\u0082"), 165 | }; 166 | var BUTTON_RESOURCES = { 167 | btn_min: '({total:7, '+ 168 | 'shape_6:{fillColor:[0.5, 0.5, 0.5], name:"", tag:"", strokeColor:[0, 0, 0], pathPoints:[[30, 30], [1, 30], [1, 0], [30, 0]], ellipsePath:false, closed:true, strokeWidth:1}, '+ 169 | 'shape_5:{fillColor:[0.9, 0.9, 0.9], name:"", tag:"", strokeColor:null, pathPoints:[[28, 29], [3, 29], [3, 4], [28, 4]], ellipsePath:false, closed:true}, '+ 170 | 'shape_4:{fillColor:null, name:"", tag:"", strokeColor:[0.2, 0.2, 0.2], pathPoints:[[4, 29], [4, 4], [28, 4]], ellipsePath:false, closed:false, strokeWidth:1}, '+ 171 | 'shape_3:{fillColor:[0.2, 0.2, 0.2], name:"", tag:"", strokeColor:null, pathPoints:[[27, 28], [21, 28], [21, 22], [27, 22]], ellipsePath:false, closed:true}, '+ 172 | 'shape_2:{fillColor:null, name:"", tag:"", strokeColor:[0.4, 0.4, 0.4], pathPoints:[[7, 8], [20, 21]], ellipsePath:false, closed:false, strokeWidth:1}, '+ 173 | 'shape_1:{fillColor:[0.8, 0.8, 0.8], name:"", tag:"", strokeColor:[0.4, 0.4, 0.4], pathPoints:[[13, 21], [20, 14], [20, 21]], ellipsePath:false, closed:true, strokeWidth:1}, '+ 174 | 'shape_0:{fillColor:null, name:"", tag:"", strokeColor:[0, 0, 0], pathPoints:[[1, 1], [29, 1]], ellipsePath:false, closed:false, strokeWidth:1}})', 175 | btn_expand: '({total:7, '+ 176 | 'shape_6:{fillColor:[0.5, 0.5, 0.5], name:"", tag:"", strokeColor:[0, 0, 0], pathPoints:[[30, 30], [1, 30], [1, 0], [30, 0]], ellipsePath:false, closed:true, strokeWidth:1}, '+ 177 | 'shape_5:{fillColor:[0.7, 0.7, 0.7], name:"", tag:"", strokeColor:null, pathPoints:[[28, 28], [3, 28], [3, 3], [28, 3]], ellipsePath:false, closed:true}, '+ 178 | 'shape_4:{fillColor:[0.8, 0.8, 0.8], name:"", tag:"", strokeColor:null, pathPoints:[[27, 27], [4, 27], [4, 4], [27, 4]], ellipsePath:false, closed:true}, '+ 179 | 'shape_3:{fillColor:[0.9, 0.9, 0.9], name:"", tag:"", strokeColor:null, pathPoints:[[26, 26], [5, 26], [5, 5], [26, 5]], ellipsePath:false, closed:true}, '+ 180 | 'shape_2:{fillColor:null, name:"", tag:"", strokeColor:[0, 0, 0], pathPoints:[[1, 1], [29, 1]], ellipsePath:false, closed:false, strokeWidth:1}, '+ 181 | 'shape_1:{fillColor:[0.3, 0.3, 0.3], name:"", tag:"", strokeColor:null, pathPoints:[[15, 24], [7, 18], [24, 18]], ellipsePath:false, closed:true}, '+ 182 | 'shape_0:{fillColor:[0.3, 0.3, 0.3], name:"", tag:"", strokeColor:null, pathPoints:[[15, 8], [7, 14], [24, 14]], ellipsePath:false, closed:true}})', 183 | btn_collapse: '({total:7, '+ 184 | 'shape_6:{fillColor:[0.5, 0.5, 0.5], name:"", tag:"", strokeColor:[0, 0, 0], pathPoints:[[30, 30], [1, 30], [1, 0], [30, 0]], ellipsePath:false, closed:true, strokeWidth:1}, '+ 185 | 'shape_5:{fillColor:[0.7, 0.7, 0.7], name:"", tag:"", strokeColor:null, pathPoints:[[28, 28], [3, 28], [3, 3], [28, 3]], ellipsePath:false, closed:true}, '+ 186 | 'shape_4:{fillColor:[0.8, 0.8, 0.8], name:"", tag:"", strokeColor:null, pathPoints:[[27, 27], [4, 27], [4, 4], [27, 4]], ellipsePath:false, closed:true}, '+ 187 | 'shape_3:{fillColor:[0.9, 0.9, 0.9], name:"", tag:"", strokeColor:null, pathPoints:[[26, 26], [5, 26], [5, 5], [26, 5]], ellipsePath:false, closed:true}, '+ 188 | 'shape_2:{fillColor:null, name:"", tag:"", strokeColor:[0, 0, 0], pathPoints:[[1, 1], [29, 1]], ellipsePath:false, closed:false, strokeWidth:1}, '+ 189 | 'shape_1:{fillColor:[0.3, 0.3, 0.3], name:"", tag:"", strokeColor:null, pathPoints:[[15, 18], [7, 24], [24, 24]], ellipsePath:false, closed:true}, '+ 190 | 'shape_0:{fillColor:[0.3, 0.3, 0.3], name:"", tag:"", strokeColor:null, pathPoints:[[15, 14], [7, 8], [24, 8]], ellipsePath:false, closed:true}})', 191 | btn_estk: '({total:8, '+ 192 | 'shape_7:{fillColor:[0.5, 0.5, 0.5], name:"", tag:"", strokeColor:[0, 0, 0], pathPoints:[[30, 30], [1, 30], [1, 0], [30, 0]], ellipsePath:false, closed:true, strokeWidth:1}, '+ 193 | 'shape_6:{fillColor:[0.7, 0.7, 0.7], name:"", tag:"", strokeColor:null, pathPoints:[[28, 28], [3, 28], [3, 3], [28, 3]], ellipsePath:false, closed:true}, '+ 194 | 'shape_5:{fillColor:[0.8, 0.8, 0.8], name:"", tag:"", strokeColor:null, pathPoints:[[27, 27], [4, 27], [4, 4], [27, 4]], ellipsePath:false, closed:true}, '+ 195 | 'shape_4:{fillColor:[0.9, 0.9, 0.9], name:"", tag:"", strokeColor:null, pathPoints:[[26, 26], [5, 26], [5, 5], [26, 5]], ellipsePath:false, closed:true}, '+ 196 | 'shape_3:{fillColor:null, name:"", tag:"", strokeColor:[0, 0, 0], pathPoints:[[1, 1], [29, 1]], ellipsePath:false, closed:false, strokeWidth:1}, '+ 197 | 'shape_2:{fillColor:null, name:"", tag:"", strokeColor:[0.2, 0.2, 0.2], pathPoints:[[10, 12], [5, 16], [10, 20]], ellipsePath:false, closed:false, strokeWidth:2}, '+ 198 | 'shape_1:{fillColor:null, name:"", tag:"", strokeColor:[0.2, 0.2, 0.2], pathPoints:[[20, 12], [25, 16], [20, 20]], ellipsePath:false, closed:false, strokeWidth:2}, '+ 199 | 'shape_0:{fillColor:null, name:"", tag:"", strokeColor:[0.2, 0.2, 0.2], pathPoints:[[12, 24], [18, 8]], ellipsePath:false, closed:false, strokeWidth:2}})', 200 | btn_find: '({total:9, '+ 201 | 'shape_8:{fillColor:[0.5, 0.5, 0.5], name:"", tag:"", strokeColor:[0, 0, 0], pathPoints:[[30, 30], [1, 30], [1, 0], [30, 0]], ellipsePath:false, closed:true, strokeWidth:1}, '+ 202 | 'shape_7:{fillColor:[0.7, 0.7, 0.7], name:"", tag:"", strokeColor:null, pathPoints:[[28, 28], [3, 28], [3, 3], [28, 3]], ellipsePath:false, closed:true}, '+ 203 | 'shape_6:{fillColor:[0.8, 0.8, 0.8], name:"", tag:"", strokeColor:null, pathPoints:[[27, 27], [4, 27], [4, 4], [27, 4]], ellipsePath:false, closed:true}, '+ 204 | 'shape_5:{fillColor:[0.9, 0.9, 0.9], name:"", tag:"", strokeColor:null, pathPoints:[[26, 26], [5, 26], [5, 5], [26, 5]], ellipsePath:false, closed:true}, '+ 205 | 'shape_4:{fillColor:null, name:"", tag:"", strokeColor:[0, 0, 0], pathPoints:[[1, 1], [29, 1]], ellipsePath:false, closed:false, strokeWidth:1}, '+ 206 | 'shape_3:{fillColor:[0.57, 0.92, 1], name:"", tag:"", strokeColor:[0.2, 0.2, 0.2], pathPoints:[12, 5, 13, 13], ellipsePath:true, closed:true, strokeWidth:2}, '+ 207 | 'shape_2:{fillColor:null, name:"", tag:"", strokeColor:[0.5, 0.5, 0.5], pathPoints:[[14, 17], [6, 25]], ellipsePath:false, closed:false, strokeWidth:2}, '+ 208 | 'shape_1:{fillColor:null, name:"", tag:"", strokeColor:[0.3, 0.3, 0.3], pathPoints:[[13, 18], [6, 25]], ellipsePath:false, closed:false, strokeWidth:5}, '+ 209 | 'shape_0:{fillColor:[0.88, 0.98, 1], name:"", tag:"", strokeColor:[0.88, 0.98, 1], pathPoints:[15, 8, 4, 4], ellipsePath:true, closed:true, strokeWidth:2}})', 210 | btn_plus : '({total:8, '+ 211 | 'shape_7:{fillColor:[0.4, 0.4, 0.4], name:"", tag:"", strokeColor:null, pathPoints:[[31, 31], [0, 31], [0, 0], [31, 0]], ellipsePath:false, closed:true}, '+ 212 | 'shape_6:{fillColor:[0.6, 0.6, 0.6], name:"", tag:"", strokeColor:null, pathPoints:[[30, 30], [1, 30], [1, 1], [30, 1]], ellipsePath:false, closed:true}, '+ 213 | 'shape_5:{fillColor:[0.8, 0.8, 0.8], name:"", tag:"", strokeColor:null, pathPoints:[[29, 29], [2, 29], [2, 2], [29, 2]], ellipsePath:false, closed:true}, '+ 214 | 'shape_4:{fillColor:[0.95, 0.95, 0.95], name:"", tag:"", strokeColor:null, pathPoints:[[28, 28], [3, 28], [3, 3], [28, 3]], ellipsePath:false, closed:true}, '+ 215 | 'shape_3:{fillColor:[1, 1, 1], name:"", tag:"", strokeColor:null, pathPoints:[[27, 27], [4, 27], [4, 4], [27, 4]], ellipsePath:false, closed:true}, '+ 216 | 'shape_2:{fillColor:[0.4, 0.4, 0.4], name:"", tag:"", strokeColor:[0.2, 0.2, 0.2], pathPoints:[[26, 14], [17, 14], [17, 5], [14, 5], [14, 14], [5, 14], [5, 17], [14, 17], [14, 26], [17, 26], [17, 17], [26, 17]], ellipsePath:false, closed:true, strokeWidth:1}, '+ 217 | 'shape_1:{fillColor:[0.2, 0.2, 0.2], name:"", tag:"", strokeColor:null, pathPoints:[[26, 14], [17, 14], [17, 5], [14, 5], [14, 14], [5, 14], [5, 17], [14, 17], [14, 26], [17, 26], [17, 17], [26, 17]], ellipsePath:false, closed:true}, '+ 218 | 'shape_0:{fillColor:[0, 1, 0], name:"", tag:"", strokeColor:null, pathPoints:[[15, 25], [15, 16], [6, 16], [6, 15], [15, 15], [15, 6], [16, 6], [16, 15], [25, 15], [25, 16], [16, 16], [16, 25]], ellipsePath:false, closed:true}})', 219 | btn_save :'({total:8, '+ 220 | 'shape_7:{fillColor:[0.4, 0.4, 0.4], name:"", tag:"", strokeColor:null, pathPoints:[[31, 31], [0, 31], [0, 0], [31, 0]], ellipsePath:false, closed:true}, '+ 221 | 'shape_6:{fillColor:[0.6, 0.6, 0.6], name:"", tag:"", strokeColor:null, pathPoints:[[30, 30], [1, 30], [1, 1], [30, 1]], ellipsePath:false, closed:true}, '+ 222 | 'shape_5:{fillColor:[0.8, 0.8, 0.8], name:"", tag:"", strokeColor:null, pathPoints:[[29, 29], [2, 29], [2, 2], [29, 2]], ellipsePath:false, closed:true}, '+ 223 | 'shape_4:{fillColor:[0.95, 0.95, 0.95], name:"", tag:"", strokeColor:null, pathPoints:[[28, 28], [3, 28], [3, 3], [28, 3]], ellipsePath:false, closed:true}, '+ 224 | 'shape_3:{fillColor:[1, 1, 1], name:"", tag:"", strokeColor:null, pathPoints:[[27, 27], [4, 27], [4, 4], [27, 4]], ellipsePath:false, closed:true}, '+ 225 | 'shape_2:{fillColor:[0.7, 0.9, 1], name:"", tag:"", strokeColor:[0.4, 0.4, 0.4], pathPoints:[[26, 25], [6, 25], [6, 5], [26, 5]], ellipsePath:false, closed:true, strokeWidth:1}, '+ 226 | 'shape_1:{fillColor:[0.95, 0.95, 0.95], name:"", tag:"", strokeColor:[0.4, 0.4, 0.4], pathPoints:[13, 14, 5, 5], ellipsePath:true, closed:true, strokeWidth:1}, '+ 227 | 'shape_0:{fillColor:[0.95, 0.95, 0.95], name:"", tag:"", strokeColor:[0.4, 0.4, 0.4], pathPoints:[[22, 11], [10, 11], [10, 5], [22, 5]], ellipsePath:false, closed:true, strokeWidth:1}})' 228 | }; 229 | var IMAGE_RESOURCES_2 = { 230 | img_logo2 : ScriptUI.newImage("\u0089PNG\r\n\x1A\n\x00\x00\x00\rIHDR\x00\x00\x00d\x00\x00\x00-\b\x02\x00\x00\x00\u00D7\u00D7Y\u00A7"+ 231 | "\x00\x00\x00\x19tEXtSoftware\x00Adobe ImageReadyq\u00C9e<\x00\x00\x03\u00F3IDATx\u00DA\u00EC[\u00E9\u0091\u00EA0\fvv\u00A9\u00826"+ 232 | "\u00A0\u00A6P\x07e@\x1D\u0094\x01uPF\u009E\x06\r\x1A\u00AD$\u00CB\u00B2\u009Dpd\u009E~\u00EC\u0090\u00C4\u0087\u00A2\u00DB\u009F"+ 233 | "\u00B2\u00C34M\u00A9\u009En\u00B7\x1B\u00FC=\u009F\u00CFt\x07\x7F\u008F\u00E3\u00C8\u00EF\u00E3\u00A5\x1Es:\u009D\u00D2\x17\u00D2"+ 234 | "\u00D0,,\u0092\b\x17\u00D9\u00F5z\u00DD\u00EDv(\u00CA\u00FD~/\x16\u00C7\u00FB@0f\u00B5\u00C2\x12v\u00C4\u00A5\u00A3\t\r\x07\u00A6|"+ 235 | "\u00A9D\x1C\u00DAD\u00CC\u00C7\u0097\u008E .S4\u00B4\u0095\x0B\u00EBp8T\t\u00C8\u00B4\u00AF\u00B4>\u009A\x145\u00BF'L\u00BC>"+ 236 | "\b~Lo%\u00E0a\u0089e\u0093\u00DE\u00A6MF\x7F\x16}D\u00FAwI\n\u0095\u00BD\x04\x03?\u00E2\u00CD!\u0085\u00D5\u008A\t\u00C29\x0FL"+ 237 | "\u0094\u00F2\x1C\x027\x1F\u009Etx\u00D0\u00DB=\f\u00D8\x066\n\u00CC7\u0098\u00956%\u009A\u008E>\u00E8\u00BB!j~|R.\x1A\u00F4"+ 238 | "\u00F8`\u0083Y\u00E1\u00BB\u00FB\x13\u0093p\u009F\u0088\u00A4\u00CC\u009Dx\u00A4s\u00B6D\u009E\u00F8\"8Q\u00AF\u0086\u0084"+ 239 | "\u00BFqA\u00BAo^\u00EA\u0089zA\u00AEN\u00C1d\u009D\u00B0\u00E2f\u0095\u0093QQR\u00A6\u00B0DB\u00A0\x05\u00F9\u00CA8 \u00C7!M"+ 240 | "\u00E7\x03\u0084\u00B0\u009C\u0089\u00B9\u00A7\u00FAERm\x12$m\u00C7\u00DDSn\u00F9\x1C\u00AC5,b3\u00BD\x06\x1FF[\u0093}\x15m"+ 241 | "\u00843L\u00B3\u00C4%\x05\u0087+\u00A3^aUE\u00B1\u009Cq\u0089\u0080E\u00A6\u00E1\u0084Q!\u00AC\u00A2\u00A7\u008B\x01$\u008B"+ 242 | "\u009C\u008DG\u00DCp3K*\u0081-\u0083\u0095:\u009E\n\u00E8 \r\x13\u00CF\x0F\u00A2\x15\u0084\u00CE\u00E0&p)\u0092T|;\u00A7TnY\u00A1"+ 243 | "\u00A7\u00C2\u008A\u0087*\u00A7\b\u00E2*5\u009F\u008A\u0094R\u00CC\u00B6\u00A6\x1B\u009A\x01W[\u0096\u00BFr\u009A\u00A5v\u008F"+ 244 | "\u00CB\u008B\u00BB\x1E\u00C6\u0085\\(1\x03\u008D\x18 $\u00C2g\u00D1\u00FAf\u00F8\u00D3\u00DE\u008DA\u0080\"\u00B2\u00E9\u00EC"+ 245 | "\u00C9\u008C\u00BE3\x1E\u009E\"'\x04?s\u0091\u00B6M]\x165\u00CD\u00D5 \u00C6\u0098q\u008D\u00E7\x1F1`\u00D0\u0090SU\x11o2\u00E7"+ 246 | "\u0084\x03\u008CY\u00C0\x07\u00EE\u0082<\u0089\u00F1\u0084v \u00F7\u00F4\u00D4,\u00AF\u00FD\u00A74\x06\u00DFKhB\u00F3\u0089"+ 247 | "\u008Bd\u00F9\x0F*\x7F\u0089\u00F8\u00F5\u00E2\u00A3u?c\u00C9\u008F,\u00EB\u0090\u0097P\x7F3(b\u0097\x0E\u0098\u00DA{ -\u00B0"+ 248 | "\u00F9\u008F\u00C2\u00DAE<\u009A3$\u00F7{b\u00A7\x0E?\u0093R\u00CE\u0099E\u0091\u00DDV\u00D3\x7Ff\u00FC\u00EA\u008AY~"+ 249 | "\u0099\u00D7fet\u00BC\u00C8\u00D5r\u0088\x1A\u00BF=3r\u00F0\u00BA\u008D\u0099MC\x02Fy\u00A1\u00C9D\u00CE\u00EEX\u00AF#\x7F&\u00DC"+ 251 | "\u00DE\u008C\"4\x102\u00DF\u00AE\u00B9Z\x1F\x11\u00E7\u00DB\u0090\u00B7?k\u0094\\\u00BD\u00F32?\u00D5(\u00F6Rn(\u008E\u0090"+ 252 | "\u00F1\u00B9`P4\u0092\u008EihMb)\u00FE\x15\u00850:\u00F1H\u009B\u00A43WD\u0092F\u00C8\u00A0!U\u00F1`\x1F\u009C\u00AE\u0081$"+ 253 | "\u008D\u008D\u00E40x\r(\u009BO9\b\u00E3\u00B0\u00D7cY\u00D5m(\x01\fE\x00e\x01\u00E0\t\fD\u0083p\u00E2\u00FD\u00F5\\\x1A\u00A0"+ 254 | "\u00A5\u00EC \u00FA3\b+nYf\u00BF+\u00D2\u00AC7\u00BB\x12\u00B9\u00B8\u00E9\u00E0Yf\x1BM\u00E0\u00F7##\u00D3\u00B8z\u0084"+ 255 | "\u00B5\u00E1\u00F8w1H\u00E9p\x00\x7F\u009D\x15\b\u00BD\u00D2O\u00F9\u00CB\u00F0\u00A8\u0084\u00BB\u00A0\\\x10\u009EoF\u00CD"+ 256 | "\u00A9\u00A6\u0099\u00F9D\u00EE7rs\u00DA\u00E6}\u009A\u009C%\u009A}\u00AA\\\u00FA#\u00C7\x11\u00F0f\u00EE<\u00A0-k\u00D1l\x18"+ 257 | "\x12VQ9BXN\x13?\u0087\u0091;!\u009C\u00B7\u00A0\u009D\u00DE\u009Fn\u00FC\u0089\u00F6\x17\u00BF\u0099\u00EB\fF:\u009E\u00E56\\U"+ 258 | "\u0097\u00C8\u0089\u00FA\u00BE\u0094\x1D\u00AD\u0088D\u00A9/\u00CD\u00E9Z\u00D0=5\u00E6 zl\u00EA\u00F1\u008F\x1C\u0083\u00A8"+ 259 | "<\n\x02\u00AB\x18\x07\u0086\u00D7H\u00B9\x06\u00E0\x1D\x1C\u00DD\u00B94\u00A7\x17?\u00EF\u00E9:9\u0090\x1Ej!fn\u00E1\u00D3J\u00A9"+ 260 | "\\\u00A3V\u00E13+\u0096\x14\u00D0\u00AFv\u0093\u00E3\u00F1x\u00BF\u00DF/\u0097\u00CBv\u00BB\u0085\x1F\u00F1O\u00D4V\u00F6\u00B9"+ 261 | "\u00AD\u00A6a\u00AE\u0085V/)\u00A0\u00DF\x19\u00D7Bc\x04J\u00FFi\u00A1/\u0090\u00BE\t)}e\u00C3\x0EO0\u00DF\u00FB\u00BF;\u00FF\x04"+ 262 | "\x18\x00\u008E\x12\u00A4D\u00A8xh\u00C0\x00\x00\x00\x00IEND\u00AEB`\u0082") 263 | }; 264 | 265 | //=================================================================================== UI helpers ================================================================================// 266 | DropDownList.prototype.selectWell = function(){ 267 | //CC will let you select null 268 | this.addEventListener('change', function(){ 269 | if(this.selection == null){ 270 | this.selection = this.items[0]; 271 | } 272 | }); 273 | } 274 | 275 | function quickView(msg, title){ 276 | if(title == undefined){ 277 | title = ''; 278 | } 279 | var w = new Window('dialog', title); 280 | var e = w.add('edittext', undefined, msg, {multiline:true, readonly:true}); 281 | e.size = [700,500]; 282 | var okbtn = w.add('button', undefined, 'Ok'); 283 | w.show(); 284 | } 285 | 286 | function drawFromObjString(objString, canvasArea){ 287 | function round2(num){ 288 | return Math.round(num*100)/100; 289 | } 290 | function drawPath(shp){ 291 | var thisShp=shp; 292 | if(thisShp.ellipsePath!=true){ 293 | var vectorPts=thisShp.pathPoints; 294 | canvas.newPath(); 295 | canvas.moveTo(thisShp.pathPoints[0][0],thisShp.pathPoints[0][1]); 296 | for(var j=0; j=0){ 326 | for(var all in obj){ 327 | if(all.match(/\d{1,2}$/g) && all.match(/\d{1,2}$/g)==counter){ 328 | var thisShp=obj[all]; 329 | if(all.match('group')){ 330 | var ctr=obj[all].total; 331 | while(ctr>=0){ 332 | for(var paths in obj[all]){ 333 | if(paths.match(/\d{1,2}$/g) && paths.match(/\d{1,2}$/g)==ctr){ 334 | drawPath(obj[all][paths]); 335 | } 336 | } 337 | ctr--; 338 | } 339 | } else { 340 | drawPath(thisShp); 341 | } 342 | } 343 | } 344 | counter-=1; 345 | } 346 | } 347 | //===============================================XML================================================================// 348 | function wrapCDATA(str, propNm){ 349 | str = ''+str+''; 350 | str = str.replace(/(\)/g, '<'+propNm+'>)/g,']]\>'+''); 352 | return XML(str); 353 | } 354 | function stringXmlSafe(str){ 355 | str=str.toString(); 356 | str=str.replace(/&(?!(amp;|gt;|lt;|quot;|apos;))/g,"&"); 357 | str=str.replace(//g,">"); 359 | str=str.replace(/'/g,"'"); 360 | str=str.replace(/"/g,"""); 361 | return str; 362 | } 363 | function getXmlConfig(xmlFile){ 364 | var myFile=xmlFile; 365 | myFile.open('r'); 366 | myFile.seek(0,0); 367 | var fileStr=myFile.read(); 368 | myFile.close(); 369 | var xmlObj=XML(fileStr); 370 | var objArr=[]; 371 | var objArr2=[]; 372 | for(var x=0, ln=xmlObj.folderObjects.children().length(); x'); 396 | var xmlBody1=new XML(''); 397 | for(var i=0; i")); xmlBody1.folderObject[i].@order=i+1; 400 | xmlBody1.folderObject[i].appendChild(new XML(""+stringXmlSafe(thisFolderObj.name)+"")); 401 | xmlBody1.folderObject[i].appendChild(new XML(""+stringXmlSafe(thisFolderObj.folderPath)+"")); 402 | xmlBody1.folderObject[i].appendChild(new XML(""+stringXmlSafe(thisFolderObj.square)+"")); 403 | xmlBody1.folderObject[i].notes=wrapCDATA(thisFolderObj.notes, 'notes'); 404 | } 405 | var xmlBody2=new XML(''); 406 | for(var i=0; i")); xmlBody2.favoriteObject[i].@order=i+1; 409 | xmlBody2.favoriteObject[i].appendChild(new XML(""+stringXmlSafe(thisFavoriteObj.filePath)+"")); 410 | xmlBody2.favoriteObject[i].appendChild(new XML(""+stringXmlSafe(thisFavoriteObj.image)+"")); 411 | xmlBody2.favoriteObject[i].notes=wrapCDATA(thisFavoriteObj.notes, 'notes'); 412 | } 413 | xmlBase.appendChild(xmlBody1); 414 | xmlBase.appendChild(xmlBody2); 415 | return xmlBase; 416 | } 417 | function getPersonalSettingsFromXML(xmlFile){ 418 | if(xmlFile.exists){ 419 | var resObj = { 420 | paletteView: 123456, 421 | openConfirm: true, 422 | openConfirmFavorite: true, 423 | openInESTKConfirm: true, 424 | syncLocations: true, 425 | tinyWindowLocation: [860, 350], 426 | bigWindowLocation: [860, 350] 427 | }; 428 | var myFile=xmlFile; 429 | myFile.open('r'); 430 | myFile.seek(0,0); 431 | var fileStr=myFile.read(); 432 | myFile.close(); 433 | var xmlObj=XML(fileStr); 434 | for(var all in resObj){ 435 | var content = xmlObj[all]; 436 | if(xmlObj.hasOwnProperty(all)){ 437 | var refinedContent; 438 | if(all == "tinyWindowLocation" || all == "bigWindowLocation"){ 439 | refinedContent = content.split(","); 440 | for(var z=0; z\r'+getXmlScriptItems(scriptItemsObj)); 465 | saveFl.close(); 466 | alert("Successfully Saved in: "+decodeURI(saveFl),'SUCCESS!'); 467 | } catch(e) { 468 | alert("Sorry, "+decodeURI(saveFl)+"'s save operation was NOT successful!",'Failure... Horrible abysmal failure. :\'('); 469 | } 470 | } 471 | function savePersonalXML(dest, obj){ 472 | XML.prettyIndent=4; 473 | var xmlBase=new XML(''); 474 | for(var all in obj){ 475 | xmlBase[all] = obj[all]; 476 | } 477 | 478 | var saveFl = (dest instanceof File) ? dest : File(dest); 479 | try { 480 | saveFl.open('w'); 481 | saveFl.write('\r'+xmlBase); 482 | saveFl.close(); 483 | alert("Successfully Saved in: "+decodeURI(saveFl),'SUCCESS!'); 484 | } catch(e) { 485 | alert("Sorry, "+decodeURI(saveFl)+"'s save operation was NOT successful!",'Failed to save personal settings.'); 486 | } 487 | } 488 | 489 | //===================================================================================================================================== Init / OBJECTS ==================================// 490 | var AIversion = app.version.split(/\./)[0]; 491 | var putImages = (AIversion > 15 || (AIversion == 15 && $.os.match('Macintosh'))) ? true : false ; // not working right in treeview Windows7 CS5 492 | var PaletteViews = { 493 | VIEW_FOLDERS: 123456, 494 | VIEW_FAVORITES: 123457 495 | }; 496 | var SETTINGS = { 497 | paletteView: PaletteViews.VIEW_FOLDERS, 498 | windowGraphics: true, 499 | admin: admin, 500 | openConfirm: true, 501 | openConfirmFavorite: true, 502 | openInESTKConfirm: true, 503 | putImages: putImages, 504 | configFile: configFile, 505 | personalConfigFile: personalConfigFile, 506 | AIversion: AIversion, 507 | syncLocations: true, 508 | tinyWindowLocation: [860, 350], 509 | bigWindowLocation: [860, 350] 510 | }; 511 | 512 | //get personal settings 513 | var personalSettings = getPersonalSettingsFromXML(SETTINGS.personalConfigFile); 514 | if(personalSettings != null){ 515 | for(var all in personalSettings){ 516 | if(SETTINGS.hasOwnProperty(all)){ 517 | SETTINGS[all] = personalSettings[all]; 518 | } 519 | } 520 | } 521 | 522 | var SCRIPTFOLDERS, FAVORITES; 523 | //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< "SCRIPTFOLDERS" and "FAVORITES" objects 524 | // start off with these 2 required folders. 525 | if($.os.match('Windows')){ 526 | //PC 527 | SCRIPTFOLDERS = [ 528 | {name: "Application Scripts", folderPath: (decodeURI(app.path)+"/Presets/"+app.locale+"/Scripts"), square: "square_none", notes: ""}, 529 | {name: "Adobe Scripts", folderPath: (Folder.myDocuments).fsName+"\\Adobe Scripts", square: "square_none", notes: ""}, 530 | ]; 531 | } else { 532 | // MAC 533 | SCRIPTFOLDERS = [ 534 | {name: "Application Scripts", folderPath: (decodeURI(app.path)+"/Presets.localized/"+app.locale+"/Scripts"), square: "square_none", notes: ""}, 535 | {name: "Adobe Scripts", folderPath: (Folder.myDocuments).fsName+"/Adobe Scripts", square: "square_none", notes: ""}, 536 | ]; 537 | } 538 | FAVORITES = []; 539 | 540 | var configFile = SETTINGS.configFile; 541 | 542 | if(configFile.exists){ 543 | var xmlData = getXmlConfig(configFile); // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< read the Config File 544 | for(var i=0; i-1; j--){ 548 | var dataItem = xmlData.folderObjects[j]; 549 | if(item.name == dataItem.name){ 550 | for(var v in item){ 551 | item[v] = dataItem[v]; 552 | } 553 | xmlData.folderObjects.splice(j, 1); 554 | } 555 | } 556 | } 557 | // join remaining config folders with the default ones. 558 | SCRIPTFOLDERS = SCRIPTFOLDERS.concat(xmlData.folderObjects); 559 | if(xmlData.favoriteObjects != undefined){ 560 | FAVORITES = xmlData.favoriteObjects; 561 | } else { 562 | FAVORITES = []; 563 | } 564 | } 565 | 566 | refreshFiles(); 567 | 568 | SCRIPTFOLDERS.getByName = function(name){ 569 | for(var i=this.length-1; i>-1; i--){ 570 | var item = this[i]; 571 | if(item.name == name){ 572 | return item; 573 | } else if(i==0){ 574 | return null; 575 | } 576 | } 577 | } 578 | 579 | //===================================== Functions ================================================================================================// 580 | function refreshFiles(){ 581 | for(var i=0; i= array.length-1){ 1120 | array.push(item); 1121 | } 1122 | } 1123 | } 1124 | function suggestiveSearchFunc(find, in_array){ 1125 | var a = in_array; 1126 | var res = []; 1127 | for(var k1=0; k1 0){ 1288 | for(var j=0; j-1; i--){ 1313 | var thisChild = g.children[i]; 1314 | g.remove(thisChild); 1315 | } 1316 | 1317 | setupFavorites(g, FAVORITES); 1318 | if(FAVORITES.length <= 7){ 1319 | g.window.layout.layout(true); 1320 | } else { 1321 | g.layout.layout(true); 1322 | if(FAVORITES.length >= 7){ 1323 | var scrollBarHt = 500; 1324 | var sc = g.parent.children[1]; 1325 | var ht = FAVORITES.length * 70; 1326 | sc.onChange = sc.onChanging = function(){ 1327 | for(var i=0; i 0){ 1346 | var addScroll = (favoriteObjects.length >= 7)? true : false; 1347 | for(var i=0; i 0){ 1760 | if(t.items.length > 1){ 1761 | t.items[1].expanded = true; 1762 | } else { 1763 | t.items[0].expanded = true; 1764 | } 1765 | } 1766 | var enableFolderItems = (SETTINGS.admin)? [btn_configuration] : []; 1767 | refreshViews(t, favListGroupHolder, [g2], [g2_2], enableFolderItems); 1768 | } 1769 | this.show = function(){w.show();} 1770 | } 1771 | var thisPaletteWindow = new paletteWindow(); 1772 | thisPaletteWindow.show(); 1773 | } 1774 | 1775 | ScriptPanel(); --------------------------------------------------------------------------------