Generate a KBar toolbar with NodeJS
Note: This only creates script buttons with SVG icons and a single script file
Manually creating a toolbar for every product update is tedious. Save time and avoid release anxiety by automating it.
| /* | |
| copyColorsToClipboard.jsx by https://github.com/Inventsable | |
| For revisions email: tom@inventsable.cc | |
| Illustrator script to copy selected color values in the form [TYPE]=[VALUES] to a user's clipboard, | |
| preferring SPOT color names over values | |
| Discussion: https://community.adobe.com/t5/illustrator-discussions/copy-color-values-to-clipboard/m-p/13791617 | |
| Modification by Sergey Osokin, https://github.com/creold: | |
| - Added path collection within groups |
| var deep = true, // Set to false if you don't want to recursively sort layers within layers too | |
| isLowerFirst = true; // Set it to false if you want to place the layers with the first uppercase letter above | |
| // Convert ILST collection into standard Array so we can use Array methods | |
| function get(type, parent) { | |
| if (arguments.length == 1 || !parent) parent = app.activeDocument; | |
| var result = []; | |
| if (!parent[type]) return result; | |
| for (var i = 0; i < parent[type].length; i++) result.push(parent[type][i]); | |
| return result; |
| /*-------------------------------------------------------------------------------------------------------------------------*/ | |
| /** | |
| * Adds JSON library support for engines that do not include it natively. | |
| */ | |
| "object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(t){return 10>t?"0"+t:t}function quote(t){ | |
| return escapable.lastIndex=0,escapable.test(t)?'"'+t.replace(escapable,function(t){var e=meta[t]; | |
| return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'} | |
| 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)), | |
| "function"==typeof rep&&(p=rep.call(e,t,p)),typeof p){case"string":return quote(p);case"number":return isFinite(p)?String(p):"null"; | |
| case"boolean":case"null":return String(p);case"object":if(!p)return"null";if(gap+=indent,u=[],"[object Array]"===Object.prototype.toString.apply(p)){ |
| /* | |
| * Usage : | |
| * | |
| * new SelectionExporter( | |
| * app.activeDocument.selection[0], | |
| * '/tmp/somefolder/tempfile.ai', | |
| * 'My File' | |
| * ); | |
| */ |
| const { Worker, isMainThread, parentPort } = require('worker_threads'); | |
| if (isMainThread) { | |
| // This code is executed in the main thread and not in the worker. | |
| // Create the worker. | |
| const worker = new Worker(__filename); | |
| // Listen for messages from the worker and print them. | |
| worker.on('message', (msg) => { console.log(msg); }); | |
| } else { | |
| // This code is executed in the worker and not in the main thread. |
| #!/usr/bin/env node | |
| /** | |
| * | |
| * This code will ensure that before every commit in your client repository, your branch name and commit message adheres to a certain contract. | |
| * In this example, branch names must be like 'feature/AP-22-some-feature-name' or 'hotfix/AP-30-invitation-email-not-sending', and commit messages must start like some issue code, like AP-100 or AP-101. | |
| * | |
| * 'AP' just stands for Acme Platform and is an example. I made this example with Jira in mind, since Jira issue codes have this structure -as far as I know-, but is pretty easy to change it to any other issue id like #100 or $-AP-120, or whatever. | |
| * | |
| * In order for this to work, you should go to .git/hooks in any git client repository and create a commit-msg file (or modify the provided by default, commit-msg.sample) with |
| //dynamic parenting for 3d layers | |
| //from Dan Ebberts on forums I think.. | |
| //Position | |
| L=thisComp.layer("Object center"); | |
| L.toWorld(L.effect(name)("3D Point")); | |
| //Scale | |
| L =thisComp.layer("Object center"); | |
| [L.transform.scale[0]/100*value[0],L.transform.scale[1]/100*value[1],L.transform.scale[2]/100*value[2]]; |
| /** | |
| * jd-export.jsx | |
| * ------------- | |
| * Illustrator script—Exports CMYK, RGB, and Hex values for all the color | |
| * swatches in a document. CMYK to RGB conversion using Adobe’s default US | |
| * Web Coated SWOP2 to sRGB. | |
| * | |
| * | |
| * LICENSE | |
| * ------- |