Skip to content

Instantly share code, notes, and snippets.

@laryn
laryn / replace_smartobject_image.js
Last active October 29, 2024 20:36
Photoshop script to replace a smart object within a PSD with selected image(s) and save result as a JPG. (Transformations to the smart object will be applied to new images).
// Replace SmartObject’s Content and Save as JPG
// 2017, use it at your own risk
// Via @Circle B: https://graphicdesign.stackexchange.com/questions/92796/replacing-a-smart-object-in-bulk-with-photoshops-variable-data-or-scripts/93359
// JPG code from here: https://forums.adobe.com/thread/737789
#target photoshop
if (app.documents.length > 0) {
var myDocument = app.activeDocument;
var theName = myDocument.name.match(/(.*)\.[^\.]+$/)[1];
var thePath = myDocument.path;
@metacurb
metacurb / RatioExport.jsx
Last active October 17, 2023 00:35
A Photoshop script to hunt through second-level nested groups, duplicating those with a ratio for a new to a new document, and saving as a JPEG.
// Export Ratioed Images (Tested on CS5)
// Written by Beau August 2016.
// DESCRIPTION:
// This script will hunt through second-level nested groups, looking for those that have a ratio for a name
// * A new folder will be created on the Desktop to house the images
// * It will duplicate each ratio-named group to a new document
// * It will do a "Reveal all" on the new document to make sure that the image will be trimmed correctly
// * The transparent pixels will then be trimmed
// * The file is saved to the Desktop folder at max quality in JPEG format.