View Batch Mockup Smart Object Replacement.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// v.1.6. | |
// Batch Mockup Smart Object Replacement.jsx | |
// You'll need to incplude this file to another script file: | |
// #include "../script/Batch Mockup Smart Object Replacement.jsx" | |
// Check the example folders for a few real world examples. | |
// Minimal settings | |
/* |
View Export document for each layer inside selected group - scale doc 10x.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
View Read and write text.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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. |
View Illustrator convert to pdf and legacy.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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. |
View Indesign Script - Get pageitem stacking index & select item based on the same ruleset.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var selection = app.selection[0]; | |
var zIndex = getStackingIndex( selection, true ); | |
$.writeln( zIndex ); | |
// Since the last parameter is set to false, this selectPageItem() mirrors the selection | |
// - If first item is selected when the script is run, the last one will be | |
// selected when the script is done. | |
selectPageItem( selection.parentPage, zIndex, false ); | |
View Select All Layers.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
selectAllLayers(); | |
function selectAllLayers() { | |
// Select all layers (doesn't include Background) | |
try { | |
var desc = new ActionDescriptor(); | |
var ref = new ActionReference(); | |
ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') ); | |
desc.putReference( charIDToTypeID('null'), ref ); | |
executeAction( stringIDToTypeID('selectAllLayers'), desc, DialogModes.NO ); |
View Add leading & trailing space to a specific character style.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set true to "normalize" the character styled text = no extra leading & trailing spaces | |
var removeSpace = false; | |
app.findTextPreferences = null; | |
app.changeTextPreferences = null; | |
var findPref = app.findTextPreferences; | |
var changePref = app.changeTextPreferences; | |
findPref.appliedCharacterStyle = 'yellow-background'; |
View Select Next Layer (invisible or not).jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Select Next Layer (invisible or not).jsx | |
// https://gist.github.com/joonaspaakko/048c9b58ccbb6e6f44c894bf4ce30b68 | |
nextLayer('down'); | |
// direction (↑): "up" or "above" | |
// direction (↓): "down" or "below" | |
function nextLayer( direction ) { | |
var doc = app.activeDocument; |
View Compare Selected Comps.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Version 1.1. | |
// Compare Selected Comps.jsx | |
// https://gist.github.com/joonaspaakko/adbe208a867f8681afa86032f91f5099?ts=2 | |
// ######### | |
// Changelog | |
// ######### | |
// v.1.1. | |
// - Tested in Photoshop CC 2019 |
View Page Numbers To Percentages.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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↓). |
NewerOlder