Skip to content

Instantly share code, notes, and snippets.

View Inventsable's full-sized avatar
🌎
Now I am become Life, the creator of worlds

Tom Scharstein Inventsable

🌎
Now I am become Life, the creator of worlds
View GitHub Profile
// No need for target lines, redundant in standalone scripts not utilizing Bridgetalk.
// Not personally a fan of writing out globals like this, a bit messy/cluttered to my mind.
// The active document
var doc = app.activeDocument;
// The path of the original document
var originalDocPath = doc.path;
// The name of the original document
var originalDocName = doc.name;
@Inventsable
Inventsable / scrambleIllustratorText.js
Last active September 15, 2021 06:56
Simple way to scramble all text inside an Illustrator document
/**
* Scramble all text within an Illustrator document
* https://gist.github.com/Inventsable/8914a86153a6fad831904bb69199621c
*
* Uses a very simple method to randomize each letter, not something like Ipsum text.
* If not using a monospace font, can cause overflow or change of dimensions.
*
* Example: "Lorem ipsum" becomes "gtnuq muwne"
*/
@Inventsable
Inventsable / sortLayers.jsx
Last active September 9, 2021 07:29
Recursively sort all layers in Illustrator alphabetically
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;
<!DOCTYPE html>
<!-- This is the main HTML code inside the installed extension location -->
<html lang="en">
<head>
<meta charset="utf-8" />
<title>testDocker</title>
</head>
<body style="margin: 0; border: 0; overflow:hidden;">
<!-- We create an iframe to fill the available space and give it an id -->
@Inventsable
Inventsable / jumble.js
Created January 10, 2020 05:24
Word jumble expression for After Effects
posterizeTime(thisComp.layer("controller").effect("posterizer")("Slider")/2);
// The Array of words to jumble
let words = ['My', 'name', 'is', 'Blonky'];
// the digits parameter below is an Array. It contains the result of all rolling, and determines which word above to choose
function roll(digits) {
// attempt to roll a number between the first and last word
let dice = randomInteger(0, words.length - 1);
// if the number was already rolled, roll again
@Inventsable
Inventsable / launchLocalHost.js
Created July 17, 2019 02:00
Launch the localhost debugging window for any Adobe CEP panel without knowing the app, port number, or using CSInterface
function launchLocalHost() {
// Find the path to the .debug file within your current extension
const debug = window.cep.fs.readFile(
`${decodeURI(window.__adobe_cep__.getSystemPath("extension")).replace(
/file\:\/{1,}/,
""
)}/.debug`
);
// Match the line indicating the active application's port number
const port = new RegExp(