Skip to content

Instantly share code, notes, and snippets.

View joonaspaakko's full-sized avatar
🍕
Pizza...

Joonas Pääkkö joonaspaakko

🍕
Pizza...
View GitHub Profile
/*
This script resizes every layer within the active document.
How to use:
- Photoshop script ( cs3+ )
- Put in {photoshop_root}/presets/scripts/Resize Each Layer.jsx
- Run from: File > Scripts > Resize Each Layer
- ..or save the file where ever you want and run from there with: File > Scripts > Browse...
@joonaspaakko
joonaspaakko / Photoshop - Selected Layer Comps to PSD
Last active August 29, 2015 14:02
Helps you save selected layer comps as a single psd file.
/*
Author: https://github.com/joonaspaakko
Gist: https://gist.github.com/joonaspaakko/09e8e2a218038e15344d
<javascriptresource>
<name>Menu=Selected Layer Comps to PSD...</name>
<category>layercomps</category>
</javascriptresource>
@joonaspaakko
joonaspaakko / Check Master Page Numbers v.2.2.jsx
Last active May 11, 2020 10:28
Indesign script that generates a text file with information on which pages each master page is applied to.
// Version 2.2
// https://gist.github.com/joonaspaakko/efc6eb11759965d54b20
// *************
// Changelog:
// *************
// v.2.2.
// - Changed some of the wording in the output.
//
// v.2.1.
@joonaspaakko
joonaspaakko / Export document for each layer inside selected group.jsx
Last active January 23, 2024 05:52
Photoshop script that saves the whole document for each top level layer inside the selected group.
// 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 / Duplicate a group & Unlink Smart objects inside.jsx
Last active April 9, 2020 15:25
Script for photoshop that duplicates layers or groups and unlinks any possible smart objects.
// Launch application from Illustrator
var external_app = new File("/Applications/Better Rename 9.app");
external_app.execute();
// https://gist.github.com/joonaspaakko/ace1ec3455b6959dc611
#target photoshop
// If there are any documents open, run the code...
// =================================================
if ( app.documents.length > 0 ) {
// Used later on when the layers are duplicated back to the original document.
// ===========================================================================
@joonaspaakko
joonaspaakko / Illustrator convert to legacy.jsx
Last active October 8, 2024 05:16
Finds all Illustrator files from the input folder + its subfolders and converts them to an older version.
// 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 / Circulate foreground color.jsx
Last active October 11, 2023 16:45
The script switches foreground color to the next color in the "colors" variable each time you run the code.
#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 / Save as JPEG.jsx
Created March 29, 2016 10:05
Saves a file in Photoshop as jpg. File path is based on current document and filename is based on current layer.
var doc = app.activeDocument;
var fileName = doc.activeLayer.name;
var outputLocation= File( doc.path + "/" + fileName );
save( outputLocation );
function save( outputLocation ) {
var saveOptions = new ExportOptionsSaveForWeb;