Skip to content

Instantly share code, notes, and snippets.

Avatar
🍕
Pizza...

Joonas Pääkkö joonaspaakko

🍕
Pizza...
View GitHub Profile
@joonaspaakko
joonaspaakko / Export document for each layer inside selected group - scale doc 10x.jsx
Last active May 12, 2022
Export document for each layer inside selected group - scale doc 10x
View Export document for each layer inside selected group - scale doc 10x.jsx
// Name: Export document for each layer inside selected group.jsx
// Formerly: Export Layers Inside Selected Group.jsx
// Description: Photoshop script that saves the whole document for each top level layer inside the selected group.
// Image example: https://user-images.githubusercontent.com/1164476/49152494-aef8af00-f31b-11e8-80ff-d774e3103eae.png
// https://gist.github.com/joonaspaakko/013a223e94ba0fb9a2a0
#target photoshop
@joonaspaakko
joonaspaakko / Circulate foreground color.jsx
Last active May 11, 2022
The script switches foreground color to the next color in the "colors" variable each time you run the code.
View Circulate foreground color.jsx
#target photoshop
// https://gist.github.com/joonaspaakko/347c270f15bc1d11efe9
var colors = [ "#0033ff", "#9a3838", "#888888", "#a6ad1e" ];
function init() {
var read = tempFile.read(),
color = colors[ read ];
@joonaspaakko
joonaspaakko / Export document for each layer inside selected group.jsx
Last active May 11, 2022
Photoshop script that saves the whole document for each top level layer inside the selected group.
View Export document for each layer inside selected group.jsx
// Name: Export document for each layer inside selected group.jsx
// Formerly: Export Layers Inside Selected Group.jsx
// Description: Photoshop script that saves the whole document for each top level layer inside the selected group.
// Image example: https://user-images.githubusercontent.com/1164476/49152494-aef8af00-f31b-11e8-80ff-d774e3103eae.png
// https://gist.github.com/joonaspaakko/013a223e94ba0fb9a2a0
#target photoshop
@joonaspaakko
joonaspaakko / Illustrator convert to legacy.jsx
Last active Mar 23, 2022
Finds all Illustrator files from the input folder + its subfolders and converts them to an older version.
View Illustrator convert to legacy.jsx
// https://gist.github.com/joonaspaakko/df2f9e31bdb365a6e5df
// Finds all .ai files from the input folder + its subfolders and converts them to the version given below in a variable called "targetVersion"
// Tested in Illustrator cc 2014 (Mac)
// Didn't bother to do a speed test with my macbook air...
#target illustrator
// If set to false, a new file will be written next to the original file.
@joonaspaakko
joonaspaakko / SaveTo (PS-AI).jsx
Last active Nov 3, 2021
SaveTo.jsx script (v.1.3.) for Photoshop and Illustrator. The idea is that it exports the work file and the production file at the same time, saving some time and effort.
View SaveTo (PS-AI).jsx
// https://gist.github.com/joonaspaakko/b878d993b038b98b8ca78cc859916af4
// The idea is that it exports the work file and the production file (or a preview file) at the same time saving some time and effort.
// - This has been tested in Photoshop CC and Illustrator CC. It used to work in CS3, but I'm fairly sure I've changed the code enough at this point to break it for older versions.
// - Has a simple dialog where you can rename the file or leave it as it is.
// - If document has been saved, the script will suggest saving in the same path, otherwise it will default to what's set in the variable "newDocPath".
// - Photoshop saves .jpg and .psd
// - Illustrator saves .pdf and .ai and there's now the additional jpg option
@joonaspaakko
joonaspaakko / Read and write text.jsx
Created Oct 11, 2021
Read and write text example in Adobe extendscript
View Read and write text.jsx
// In this demo:
// 1. I first prep the output file path
// 2. Then write the text file: "current date and time + some placeholder text"
// - As long as you don't change the path, it gets written next to this script file.
// 3. Then read the text file
// 4. And finally trigger alert() to show the text that was written.
// - At the top it shows each line as an array
// - And below that it just shows the full text as it was written.
@joonaspaakko
joonaspaakko / Page Numbers To Percentages.jsx
Last active Sep 12, 2021
Indesign script for converting page numbers to percentages.
View Page Numbers To Percentages.jsx
// Version.1.0.
// Page Numbers To Percentages.jsx
// https://gist.github.com/joonaspaakko/6628e2b6252d622b1b7f7eba601f6c91
// You may want to save before running the script. Every single
// time you run the script, all text frames that are inside a
// master page or nested master pages will be torn out (overridden).
// The script assumes the starting point is this:
// 1. You have a designated layer for the page numbers (Layer name defined below↓).
View Illustrator convert to pdf and legacy.jsx
// https://gist.github.com/joonaspaakko/df2f9e31bdb365a6e5df
// Finds all .ai files from the input folder + its subfolders and converts them to the version given below in a variable called "targetVersion"
// Tested in Illustrator cc 2014 (Mac)
// Didn't bother to do a speed test with my macbook air...
#target illustrator
// If set to false, a new file will be written next to the original file.
@joonaspaakko
joonaspaakko / Apply Master To Empty Pages.jsx
Last active May 21, 2021
Indesign script that applies a master page to all empty pages in the document.
View Apply Master To Empty Pages.jsx
// https://gist.github.com/joonaspaakko/f16b47be887a2058cd0c0ac6e7ab0343
// The script doesn't check for page items inside the current master.
// That means the current master could be filled with all kinds of graphics and this script considers it an empty page.
var master;
if (app.documents.length > 0) init();
function init() {
@joonaspaakko
joonaspaakko / Compare Selected Comps.jsx
Last active Dec 11, 2020
Photoshop script for comparing selected layer comps. The script arranges layer comps on a new document for your viewing pleasure.
View Compare Selected Comps.jsx
// Version 1.1.
// Compare Selected Comps.jsx
// https://gist.github.com/joonaspaakko/adbe208a867f8681afa86032f91f5099?ts=2
// #########
// Changelog
// #########
// v.1.1.
// - Tested in Photoshop CC 2019