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
/* | |
NOTE: | |
1. Makes the assumption that only one layer is selected (only really matters when going down) | |
2. Doesn't care if the adjacent layer is a group or not | |
*/ | |
var options = { | |
direction: 'up', | |
loop: true, | |
}; |
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
// Mark all Audible library books ON THE CURRENT PAGE as finished or unfinished | |
// The script is basically a macro: it works by emulating a button click and just automating it for every single book | |
function markAs(config) { | |
config = config || {}; | |
var i = 0; | |
var elements = $(config.finished ? ".mark-as-finished-button" : ".mark-as-unfinished-button"); | |
var l = elements.length; | |
(function fn() { | |
const item = elements[i++]; | |
$(item).find("button").click(); |
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 | |
/* |
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 |
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. |
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. |
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 ); | |
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 ); |
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'; |
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; |
NewerOlder