Skip to content

Instantly share code, notes, and snippets.

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

Joonas Pääkkö joonaspaakko

🍕
Pizza...
View GitHub Profile
@joonaspaakko
joonaspaakko / Select Child Layers.jsx
Last active April 27, 2023 12:42
Select Child Layers.jsx Photoshop Script - Selects the first level of layers inside the currently active group.
// https://gist.github.com/joonaspaakko/1add5c6a905216740c9c922a657636e1
#target photoshop
if ( app.activeDocument.activeLayer.typename == 'LayerSet' ) {
app.activeDocument.suspendHistory( "Select Child Layers.jsx", "init();" );
}
function init() {
var doc = app.activeDocument;
require 'json'
require 'net/http'
# JSON parser tag, creating map for use in jekyll markdown
# Alex.Heneveld @ Cloudsoft Corp (remove spaces and add the .com)
# Released under APL 2.0
# usage: {% jsonball varname from TYPE PARAM %}
#
# where TYPE is one of {data,var,file,page}, described below
@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;
@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 / Illustrator convert to legacy.jsx
Last active December 30, 2023 10:48
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.
// 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.
// ===========================================================================
// Launch application from Illustrator
var external_app = new File("/Applications/Better Rename 9.app");
external_app.execute();
@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.
@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 / 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.