
Stephen Marsh
Community Expert
Stephen Marsh
Community Expert
Activity
Mar 13, 2025
1 Upvote
Hi! I have this problem too, I have zero idea how to fix it. I'm on a PC. And this happens to me as well, I try to load files into stack to make gifs and after the first one opens, the screen loads and then just gets rid of it completely. I don't know anything about scripts. Please help.
By @theladyash
If you know nothing about scripts and are not calling the legacy ExtendScript code from the new UXP framework, then you would be best to create a new topic as your situation isn't the same and piggybacking onto this topic will provide less visibility and limit the potential help you may receive.
Edit: You could try some simpler, alternative stacking scripts:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/combining-tiffs/m-p/13475955
https://community.adobe.com/t5/photoshop-ecosystem-discussions/layers-creating-layers/td-p/13252109
... View more
Mar 13, 2025
3 Upvotes
The following legacy ExtendScript/JavaScript code will convert the embedded smart object to an embedded PSB, allowing layers to be seamlessly added.
/*
Create Embedded PSB from Smart Object Layer.jsx
Stephen Marsh
v1.0 - 15th February 2024
https://community.adobe.com/t5/photoshop-ecosystem-ideas/editing-and-saving-a-dynamic-object-with-more-layers/idc-p/15210208
Based on:
https://community.adobe.com/t5/photoshop-ecosystem-ideas/save-multilayer-png-jpg-smart-objects-as-psb-and-automatically-replace/idi-p/12504206
* NOTE: Run this script on an open, layered embedded smart object to replace it as a PSB file (example, automatically convert an embedded JPEG to PSB)
*/
#target photoshop
// Edit the original embedded SO
app.runMenuItem(stringIDToTypeID('placedLayerEditContents'));
// Create a temp folder with a "random" name
var theTempDir = new Folder("~/Desktop/_theTempDir_51dcc44a-e898-47e8-bd34-6c1ecfe67faf");
if (!theTempDir.exists) {
theTempDir.create();
// Save the open edited embedded image to a temp PSB file
var thePSB = theTempDir + "/" + app.activeDocument.name.replace(/\.[^\.]+$/, '') + ".psb";
function s2t(s) {
return app.stringIDToTypeID(s);
}
var descriptor = new ActionDescriptor();
var descriptor2 = new ActionDescriptor();
descriptor2.putBoolean(s2t("maximizeCompatibility"), true);
descriptor.putObject(s2t("as"), s2t("largeDocumentFormat"), descriptor2);
descriptor.putPath(s2t("in"), new File(thePSB));
descriptor.putBoolean(s2t("lowerCase"), true);
descriptor.putEnumerated(s2t("saveStage"), s2t("saveStageType"), s2t("saveSucceeded"));
executeAction(s2t("save"), descriptor, DialogModes.NO);
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
// Replace the original embedded file with the temp PSB file
function s2t(s) {
return app.stringIDToTypeID(s);
}
var descriptor = new ActionDescriptor();
descriptor.putPath(s2t("null"), new File(thePSB));
executeAction(s2t("placedLayerReplaceContents"), descriptor, DialogModes.NO);
// Remove the temp PSB before the temp folder can be removed
thePSB = new File(thePSB);
thePSB.remove();
// Remove the empty temp folder
theTempDir.remove();
app.beep();
} else {
alert("Script cancelled as the temporary desktop folder already exists!");
}
Copy the code text to the clipboard
Open a new blank file in a plain-text editor (not in a word processor)
Paste the code in
Save as a plain text format file – .txt
Rename the saved file extension from .txt to .jsx
Install or browse to the .jsx file to run (see below)
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html
... View more
Mar 13, 2025
2 Upvotes
PNG files don't support multiple layers (only a single floating layer or flattened Background layer).
Smart objects when created in Photoshop from regular layer content are embedded as PSB format, which does support multiple layers.
If you place or drag in a PNG, JPEG or other file format from outside Photoshop, it is either embedded or linked in the original format.
You can always rasterise* the placed embedded PNG/JPEG and then convert it to a smart object, which will create an embedded PSB (*Rasterising the smart object will convert a scaled image to the current scaled size, so isn't always a perfect solution, a scripted solution can overcome this limitation).
... View more
Mar 13, 2025
Is the original embedded smart object in a format that doesn't accept multiple layers (JPEG, PNG etc)?
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 13, 2025
12:00 AM
1 Upvote
Mar 13, 2025
12:00 AM
1 Upvote
What are the source document dimensions in pixels?
Try using Automate > Batch to run the action, adding a fit image step and JPEG and PSD save and close as necessary.
Otherwise, this could be scripted with a custom script.
... View more
Mar 12, 2025
03:38 PM
1 Upvote
On a related note, if the task is to do the opposite and rasterize a multi-page PDF to a layered file, then the following script can be used:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/import-a-multipage-pdf-in-ps/m-p/13512460#M701052
... View more
Mar 12, 2025
03:36 PM
This script will be a real timesaver for me - thank you so much.
By @Jonathan33602961t8pp
You're welcome, if you need to do the opposite and save a multi-layered file as a multi-page PDF direct from Photoshop:
https://community.adobe.com/t5/photoshop-ecosystem-ideas/new-feature-request-layers-to-pdf/idc-p/14901556#U14901556
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 12, 2025
06:25 AM
1 Upvote
Mar 12, 2025
06:25 AM
1 Upvote
@seans94943058
Here is the ScriptingListener raw recording for a new Color Balance adjustment layer:
var idmake = stringIDToTypeID( "make" );
var desc7 = new ActionDescriptor();
var idnull = stringIDToTypeID( "null" );
var ref1 = new ActionReference();
var idadjustmentLayer = stringIDToTypeID( "adjustmentLayer" );
ref1.putClass( idadjustmentLayer );
desc7.putReference( idnull, ref1 );
var idusing = stringIDToTypeID( "using" );
var desc8 = new ActionDescriptor();
var idtype = stringIDToTypeID( "type" );
var desc9 = new ActionDescriptor();
var idshadowLevels = stringIDToTypeID( "shadowLevels" );
var list3 = new ActionList();
list3.putInteger( 0 );
list3.putInteger( 0 );
list3.putInteger( 0 );
desc9.putList( idshadowLevels, list3 );
var idmidtoneLevels = stringIDToTypeID( "midtoneLevels" );
var list4 = new ActionList();
list4.putInteger( 0 );
list4.putInteger( 0 );
list4.putInteger( 0 );
desc9.putList( idmidtoneLevels, list4 );
var idhighlightLevels = stringIDToTypeID( "highlightLevels" );
var list5 = new ActionList();
list5.putInteger( 0 );
list5.putInteger( 0 );
list5.putInteger( 0 );
desc9.putList( idhighlightLevels, list5 );
var idpreserveLuminosity = stringIDToTypeID( "preserveLuminosity" );
desc9.putBoolean( idpreserveLuminosity, true );
var idcolorBalance = stringIDToTypeID( "colorBalance" );
desc8.putObject( idtype, idcolorBalance, desc9 );
var idadjustmentLayer = stringIDToTypeID( "adjustmentLayer" );
desc7.putObject( idusing, idadjustmentLayer, desc8 );
executeAction( idmake, desc7, DialogModes.NO );
... View more
Mar 12, 2025
05:01 AM
You can also create an Action to print and close and run that via Automate > Batch command.
A script can be used to force the suppression of any dialogs.
https://community.adobe.com/t5/photoshop-ecosystem-discussions/batch-processing-for-a-print-action-of-multiple-files-has-annoying-quot-the-command-print-is-not/m-p/14007050
... View more
Mar 12, 2025
03:49 AM
@StephenFisherPhoto
I agree with @Astonished_motivation5639 – you most likely have the source file at 16 BPC, while JPEG only supports 8 BPC.
Rehashing a recent post:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/no-puedo-guardar-sencillamente-en-jpg/m-p/15203250#M857123
You can output a JPEG by:
1) File > Export As [32/16/8 BPC input for 8 BPC output]
2) Save a Copy using File > Save As ticking the a Copy checkbox or enable Legacy Save As in your File Handling preferences/settings [16/8 BPC input for 8 BPC output]
3) File > Export > Save for Web (Legacy) [16/8 BPC input for 8 BPC output]
4) Make the file, or a duplicate of the file conform to the JPEG specification, i.e., flattened with no layers, no alpha channels and only 8 BPC so that JPEG is available for File > Save As (if Legacy Save As isn't enabled).
5) Adobe Generator/Generate Image Assets
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 12, 2025
03:44 AM
1 Upvote
Mar 12, 2025
03:44 AM
1 Upvote
Please try adding a Background Layer beneath the Smart Objects.
By @c.pfaffenbichler
JJMack's collage scripts do require a Background layer. He didn't explicitly state that this was required for the smart object scripts, however, it's a good place to start.
_______
Simple Mockup Templates Four Rules:
Simple Mockup Templates Only the Smart Object Layer on the top of the Template layers stack will be updated then a Jpeg file saved.
Only Photoshop Objects are support in the top smart objects layers. That is they can not be Object File that are not supported by Photoshop like Camera RAW Files or Illustrator file like .ai, .svg.
I suggest these objects should be PSD or PSB that Photoshop creates. Avoid using PNG objects in Mockup template. For when replace content is used to replace .png objects within a .psd template which has your png's object the replace content operation is very slow.
The first None Smart Object Layer near the top of the layer stack Marks the end of Smart Object Layers the will be updated. Lower Smart Object Layers only update if they share top layers objects.
The Replacement Image Collection need to be in sub folders named obj0, obj1, obj2, .... objN. Each folder must contains the same number of replacement Image files.
... View more
Mar 12, 2025
03:40 AM
Please post a link to the Scripts.
By @c.pfaffenbichler
I made my backup publicly available here (the main scripts require a separate support script):
https://github.com/MarshySwamp/JJMack-Archive
... View more
Mar 12, 2025
03:19 AM
You're welcome!
... View more
Mar 11, 2025
09:45 PM
This has been asked for before:
https://community.adobe.com/t5/photoshop-ecosystem-ideas/add-the-my-mother-language-tamil-தமிழ்/idi-p/14948402?search-action-id=678854145342&search-result-uid=14948402
Perhaps you can add your vote!
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 11, 2025
03:42 PM
1 Upvote
Mar 11, 2025
03:42 PM
1 Upvote
@seans94943058
The block of code to create the curves adjustment layer is using Action Manager (AM) code. AM code can sometimes be specific to a certain Photoshop version, otherwise it's just a problem with the AI code.
If you wish to make this for each adjustment layer kind, you need to download and install Adobe's ScriptingListener plugin (if it works with your version), or do this with the built-in or third-party UXP developer tools, using AI will probably be hit and miss.
Here is your code updated and tested in v2021:
// Photoshop Script - Curves Adjustment Layer with Date-Based Naming (No Grouping)
try {
if (app.documents.length > 0) {
var doc = app.activeDocument;
function getFormattedDate() {
var date = new Date();
return date.getFullYear() + "-" + ("0" + (date.getMonth() + 1)).slice(-2) + "-" + ("0" + date.getDate()).slice(-2);
}
var todayDate = getFormattedDate();
// Create the Curves adjustment layer using an Action Descriptor
var idmake = stringIDToTypeID("make");
var desc179 = new ActionDescriptor();
var idnull = stringIDToTypeID("null");
var ref2 = new ActionReference();
var idadjustmentLayer = stringIDToTypeID("adjustmentLayer");
ref2.putClass(idadjustmentLayer);
desc179.putReference(idnull, ref2);
var idusing = stringIDToTypeID("using");
var desc180 = new ActionDescriptor();
var idtype = stringIDToTypeID("type");
var desc181 = new ActionDescriptor();
var idpresetKind = stringIDToTypeID("presetKind");
var idpresetKindType = stringIDToTypeID("presetKindType");
var idpresetKindDefault = stringIDToTypeID("presetKindDefault");
desc181.putEnumerated(idpresetKind, idpresetKindType, idpresetKindDefault);
var idcurves = stringIDToTypeID("curves");
desc180.putObject(idtype, idcurves, desc181);
var idadjustmentLayer = stringIDToTypeID("adjustmentLayer");
desc179.putObject(idusing, idadjustmentLayer, desc180);
executeAction(idmake, desc179, DialogModes.NO);
var newLayer = doc.activeLayer;
newLayer.name = "CURVES_Contrast_" + todayDate;
alert("Curves Adjustment Layer created!");
} else {
alert("No open document found.");
}
} catch (e) {
alert("Error: " + e);
}
... View more
Mar 11, 2025
03:26 PM
1 Upvote
@cody_1793 – I also consider this a bug, the file can only be one of three orientations at a time: Portrait, Landscape or Square.
Bug reports are still handled at a separate site for Bridge (requiring a separate user account):
https://adobebridge.uservoice.com/forums/905377-report-bugs
@ExUSA – Thank you for posting a scripted solution!
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 11, 2025
02:41 PM
1 Upvote
Mar 11, 2025
02:41 PM
1 Upvote
Thanks, Stephen, this is much help. I'll troubleshoot it further.
By @code_seeeeeker
You're welcome! Try this, it alerts all layers and also writes to a log text file on the desktop.
Modifications could be made to only report on the Illustrator smart object layers that don't match the document colour mode.
/*
Check all vector smart objects for RGB or CMYK mode.jsx
Stephen Marsh
v1.0 - 11th March 2025
https://community.adobe.com/t5/photoshop-ecosystem-discussions/smartobject-in-photoshop/td-p/15195068
Info: Saves the color mode of all vector smart object layers to a text file on the desktop
*/
#target photoshop
// Check if there is an active document
if (app.documents.length > 0) {
// Single history stage undo
app.activeDocument.suspendHistory("Undo Script", "main()");
function main() {
// Set the variables
var doc = app.activeDocument;
var docName = doc.name
var colorMode = doc.mode;
var docColorMode = "Document Color Mode = ";
// Determine the document color mode
switch (colorMode) {
case DocumentMode.GRAYSCALE:
docColorMode += "Grayscale";
break;
case DocumentMode.RGB:
docColorMode += "RGB";
break;
case DocumentMode.CMYK:
docColorMode += "CMYK";
break;
case DocumentMode.LAB:
docColorMode += "Lab";
break;
}
// Array to store the layer information
var layerInfo = [];
// Traverse all layers in the document
traverseLayers(app.activeDocument, layerInfo);
// Output the layer information to an alert
if (layerInfo.length > 0) {
alert("Info:" + "\r" + docColorMode + "\r\r" + layerInfo.join("\r\r"));
} else {
alert("Info:" + "\r" + docColorMode + "\r\r" + "No vector smart object layers found!");
}
// Output the layer information to a text file
var outputText = docName + "\r\r" + docColorMode + "\r\r";
if (layerInfo.length > 0) {
outputText += layerInfo.join("\r\r");
} else {
outputText += "No vector smart object layers found!";
}
writeToFile(outputText, "~/Desktop/SmartObjectInfo.txt");
}
} else {
alert("A file must be open to run this script!");
}
// End of script notification
alert("A text file 'SmartObjectInfo.txt' has been saved to the desktop with the color mode of all Adobe Illustrator smart object layers.");
///// Functions /////
function traverseLayers(parent, layerInfo) {
for (var i = 0; i < parent.artLayers.length; i++) {
processLayer(parent.artLayers[i], layerInfo);
}
for (var j = 0; j < parent.layerSets.length; j++) {
traverseLayers(parent.layerSets[j], layerInfo);
}
}
function processLayer(layer, layerInfo) {
if (layer.kind == LayerKind.SMARTOBJECT) {
var mySO = getSmartObjectName(layer);
if (mySO.found && /\.ai$/.test(mySO.fileRef)) {
// Convert the vector smart object to a linked PDF file to check the color mode
placedLayerConvertToLinked(layer, "~/Desktop/_temp-VectorToDelete.pdf");
// Undo the action to revert the vector smart object
executeAction(charIDToTypeID("undo"), undefined, DialogModes.NO);
// Set the path to the temporary vector file
var tempVectorFile = File("~/Desktop/_temp-VectorToDelete.pdf");
// Read the binary data of the temporary vector file
if (tempVectorFile) {
var binaryData = readBinaryFile(tempVectorFile);
if (binaryData !== null) {
var searchString = "_ColorModel: 1"; // %AI9_ColorModel: 2 for CMYK
var found = searchInBinaryData(binaryData, searchString);
if (found) {
layerInfo.push("Layer Name = " + layer.name + "\rSmart Object Color Mode = RGB");
} else {
layerInfo.push("Layer Name = " + layer.name + "\rSmart Object Color Mode = CMYK");
}
}
}
// Delete the temporary vector file
tempVectorFile.remove();
}
}
}
function writeToFile(content, filePath) {
var file = new File(filePath);
file.open("w");
file.encoding = "UTF8";
file.write(content);
file.close();
}
function getSmartObjectName(layer) {
try {
var smartObject = {
found: false,
fileRef: '',
linked: false,
};
var ref = new ActionReference();
ref.putProperty(charIDToTypeID("Prpr"), stringIDToTypeID("smartObject"));
ref.putIdentifier(charIDToTypeID("Lyr "), layer.id);
var so = executeActionGet(ref).getObjectValue(stringIDToTypeID("smartObject"));
smartObject.found = true;
smartObject.linked = so.getBoolean(stringIDToTypeID("linked"));
smartObject.fileRef = so.getString(stringIDToTypeID("fileReference"));
return smartObject;
} catch (e) {
return {
found: false,
fileRef: '',
linked: false,
};
}
}
function placedLayerConvertToLinked(layer, theTempFile) {
var s2t = function (s) {
return app.stringIDToTypeID(s);
};
var descriptor = new ActionDescriptor();
var reference = new ActionReference();
reference.putIdentifier(s2t("layer"), layer.id);
descriptor.putReference(s2t("null"), reference);
descriptor.putPath(s2t("using"), new File(theTempFile));
executeAction(s2t("placedLayerConvertToLinked"), descriptor, DialogModes.NO);
}
function readBinaryFile(tempVectorFile) {
if (!tempVectorFile.exists) {
return null;
}
tempVectorFile.open("r");
tempVectorFile.encoding = "BINARY";
var binaryData = tempVectorFile.read();
tempVectorFile.close();
return binaryData;
}
function searchInBinaryData(binaryData, searchString) {
var regex = new RegExp(searchString, "g");
return regex.test(binaryData);
}
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 11, 2025
02:20 PM
1 Upvote
Mar 11, 2025
02:20 PM
1 Upvote
@code_seeeeeker
I wrote a different script for that, so no need to alter that code:
https://community.adobe.com/t5/photoshop-ecosystem-ideas/new-feature-request-layers-to-pdf/idc-p/14901556#U14901556
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 11, 2025
06:54 AM
1 Upvote
Mar 11, 2025
06:54 AM
1 Upvote
@siliconmana as you mentioned there isnt a good solution yet to save all variations in the project. A good proposal would be something similar to what @turner111 posted which would be a "convert to layers" option but keep your original generated layer to preserve the AI results for future modification.
By @Kevin Stohlmeyer
The scripts mentioned on page 1 do just that:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/is-there-a-quot-simple-quot-way-to-export-all-generation-variations/m-p/14442568
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 10, 2025
08:18 PM
1 Upvote
Mar 10, 2025
08:18 PM
1 Upvote
@Trevor.Dennis
Hah, practice makes perfect?
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 10, 2025
05:07 PM
1 Upvote
Mar 10, 2025
05:07 PM
1 Upvote
@code_seeeeeker – The following script is for a single active layer (I started work on it before your full requirements were known). I'll look into adapting it for all layers.
/*
Check if the vector smart object in Photoshop is in RGB or CMYK mode.jsx
Stephen Marsh
v1.0 - 11th March 2025
https://community.adobe.com/t5/photoshop-ecosystem-discussions/smartobject-in-photoshop/td-p/15195068
Info: Alerts the color mode of the active vector smart object layer
*/
#target photoshop
// Check if there is an active document
if (app.documents.length > 0) {
try {
// Single history stage undo
app.activeDocument.suspendHistory("Undo Script", "main()");
function main() {
// Check that the SO is an Adobe Illustrator file
var mySO = getSmartObjectName();
if (mySO.found && /\.ai$/.test(mySO.fileRef)) {
// Check that the active layer is an embedded SO
var ref = new ActionReference();
ref.putEnumerated(charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));
ref.putProperty(charIDToTypeID("Prpr"), stringIDToTypeID("smartObject"));
ref.putEnumerated(charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));
var so = executeActionGet(ref).getObjectValue(stringIDToTypeID("smartObject"));
if (so.getBoolean(stringIDToTypeID("linked")) === false) {
// Convert the vector smart object to a linked PDF file, as a means to read the color mode
placedLayerConvertToLinked("~/Desktop/_temp-VectorToDelete.pdf");
// Undo the previous action to keep the vector smart object as it was
executeAction(charIDToTypeID("undo"), undefined, DialogModes.NO);
// Set the path to the temporary vector file
var tempVectorFile = File("~/Desktop/_temp-VectorToDelete.pdf");
// Get the active document color mode
var doc = app.activeDocument;
var colorMode = doc.mode;
var docColorMode = "Document color mode = ";
switch (colorMode) {
case DocumentMode.GRAYSCALE:
docColorMode += "Grayscale";
break;
case DocumentMode.RGB:
docColorMode += "RGB";
break;
case DocumentMode.CMYK:
docColorMode += "CMYK";
break;
case DocumentMode.LAB:
docColorMode += "Lab";
break;
}
// Read the binary data of the temporary vector file and alert if the color mode is RGB or CMYK
if (tempVectorFile) {
var binaryData = readBinaryFile(tempVectorFile);
if (binaryData !== null) {
var searchString = "_ColorModel: 1"; // %AI9_ColorModel: 2 for CMYK
var found = searchInBinaryData(binaryData, searchString);
if (found) {
alert("Color Info:" + "\r" + docColorMode + "\r" + "Vector smart object color mode = RGB");
} else {
alert("Color Info: " + "\r" + docColorMode + "\r" + "Vector smart object color mode = CMYK");
}
}
} else {
alert("The file '_temp-VectorToDelete.pdf' wasn't found on the desktop!");
}
// Delete the temporary vector file
tempVectorFile.remove();
} else {
alert("The layer isn't an Embedded Smart Object!");
}
} else {
alert("Select an Adobe Illustrator Smart Object layer!");
}
}
} catch (error) {
//alert(error + ', Line: ' + error.line);
}
} else {
alert("A file must be open to run this script!");
}
///// Functions /////
function placedLayerConvertToLinked(theTempFile) {
try {
var s2t = function (s) {
return app.stringIDToTypeID(s);
};
var descriptor = new ActionDescriptor();
var reference = new ActionReference();
reference.putEnumerated(s2t("layer"), s2t("ordinal"), s2t("targetEnum"));
descriptor.putReference(s2t("null"), reference);
descriptor.putPath(s2t("using"), new File(theTempFile));
executeAction(s2t("placedLayerConvertToLinked"), descriptor, DialogModes.NO);
} catch (error) {
//alert(error + ', Line: ' + error.line);
}
}
function readBinaryFile(tempVectorFile) {
try {
if (!tempVectorFile.exists) {
alert("File not found!");
return null;
}
tempVectorFile.open("r");
tempVectorFile.encoding = "BINARY";
var binaryData = tempVectorFile.read();
tempVectorFile.close();
return binaryData;
} catch (error) {
alert(error + ', Line: ' + error.line);
}
}
function searchInBinaryData(binaryData, searchString) {
try {
var regex = new RegExp(searchString, "g");
return regex.test(binaryData);
} catch (error) {
alert(error + ', Line: ' + error.line);
}
}
function getSmartObjectName() {
/* https://stackoverflow.com/questions/63010107/get-a-smart-objects-layers-files-directory-source-in-jsx */
try {
var smartObject = {
found: false,
fileRef: '',
linked: false,
};
var ref, so;
ref = new ActionReference();
ref.putProperty(charIDToTypeID("Prpr"), stringIDToTypeID("smartObject"));
ref.putEnumerated(charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));
so = executeActionGet(ref).getObjectValue(stringIDToTypeID("smartObject"));
smartObject.found = true;
smartObject.linked = so.getBoolean(stringIDToTypeID("linked"));
smartObject.fileRef = so.getString(stringIDToTypeID("fileReference"));
return smartObject;
}
catch (error) {
//alert(error);
return smartObject;
}
}
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 10, 2025
02:32 PM
1 Upvote
Mar 10, 2025
02:32 PM
1 Upvote
Why cant I just save as jpg?
By @Valeria_Ascencio2720
You can output a JPEG by:
1) File > Export As [32/16/8 BPC input for 8 BPC output]
2) Save a Copy using File > Save As ticking the a Copy checkbox or enable Legacy Save As in your File Handling preferences/settings [16/8 BPC input for 8 BPC output]
3) File > Export > Save for Web (Legacy) [16/8 BPC input for 8 BPC output]
4) Make the file, or a duplicate of the file conform to the JPEG specification, i.e., flattened with no layers, no alpha channels and only 8 BPC so that JPEG is available for File > Save As (if Legacy Save As isn't enabled).
5) Adobe Generator/Generate Image Assets
... View more
Mar 10, 2025
10:46 AM
Until Photoshop has AI masking that can be correctly batched, you appear to be stuck.
A long standing feature request is to save the AI masks from ACR as an alpha channel or applied layer mask.
Depending on your layer structure it might be possible to batch script combining the results of the AI masks from flattened TIFF versions with the original layered images, using their existing transparency.
... View more
Mar 10, 2025
10:28 AM
I'll post some code later on... Or you could just use xnconvert as previously suggested.
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 10, 2025
06:55 AM
1 Upvote
Mar 10, 2025
06:55 AM
1 Upvote
So when you edit the vector SO it opens into Illustrator or whatever app is set as default for the file type extension, then you know the colour mode. This is why I asked if you wanted to try avoid this.
What are you wanting? An alert to pop up stating the colour mode without having to launch Illustrator?
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 10, 2025
06:52 AM
1 Upvote
Mar 10, 2025
06:52 AM
1 Upvote
ACR is nondestructive.
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 10, 2025
05:02 AM
1 Upvote
Mar 10, 2025
05:02 AM
1 Upvote
For context, my work requires me to manually open a large amount of photos
By @noah_7511
Opening 170 files at the same time isn't a great workflow. If you must do this, you might find the following script to be useful:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/scripts-to-save-amp-restore-photoshop-sessions/m-p/14239969#U14946306
Depending on workflow and edits, if all of your images are in a single folder, a script might be better at opening them while keeping track of the next file/s to open.
https://community.adobe.com/t5/photoshop-ecosystem-discussions/how-to-open-a-number-of-images-but-one-at-a-time/m-p/13804564#U15090907
P.S. Do you even need to open the files into Photoshop? Are they all in the same folder? Could Adobe Bridge be used to select and copy the files rather than opening them in Photoshop?
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 10, 2025
05:00 AM
1 Upvote
Mar 10, 2025
05:00 AM
1 Upvote
This updated 1.1 version uses native Mac and Windows copy commands. In the case of the Mac, coloured Finder labels and Finder Comments will be preserved.
/*
Copy open files in Photoshop to a destination folder 1-1.jsx
Stephen Marsh
v1.1 - 10th March 2025
Original discussion:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/script-to-copy-the-name-of-multiple-open-documents-to-a-single-text-file/td-p/15201067
*/
#target photoshop
var destinationFolder = selectDestinationFolder();
if (destinationFolder) {
var openDocs = app.documents.length;
var initialFileCount = getFileCount(destinationFolder);
// Loop over all open documents
for (var i = 0; i < app.documents.length; i++) {
var doc = app.documents[i];
var docPath = doc.fullName.fsName; // Get the full path of the document in the OS-specific format
//alert(docPath);
if (docPath) {
// If the file copy fails, alert to the user with the path of the file that failed to copy
if (!copyFile(docPath, destinationFolder.fsName)) {
alert("Failed to copy: " + docPath);
}
}
}
var finalFileCount = getFileCount(destinationFolder);
var filesCopied = finalFileCount - initialFileCount;
// End of script notification
app.beep();
alert("Script completed!" + "\r" +
"Open document count: " + openDocs + "\n" + "Files copied: " + filesCopied);
// Open the destination folder
destinationFolder.execute();
}
function selectDestinationFolder() {
var destinationFolder = Folder.selectDialog("Select the destination folder");
if (destinationFolder == null) {
//alert("No destination folder selected. Script cancelled.");
}
return destinationFolder;
}
// New function to count files in a folder
function getFileCount(folder) {
var files = folder.getFiles();
return files.length;
}
/*
Based on:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/to-move-files-and-folders/td-p/8787869/page/2
by willcampbell7
*/
function copyFile(sourceFilePath, destinationFolderPath) {
var command;
var fileFrom = new File(new File(sourceFilePath).fsName);
var fileTo = new File(destinationFolderPath + "/" + fileFrom.name);
var folderTo = new Folder(destinationFolderPath);
if (!folderTo.exists) {
folderTo.create();
}
if (File.fs == "Macintosh") {
// First copy the file
command = "cp \"" + fileFrom.fsName + "\" \"" + fileTo.fsName + "\"";
app.system(command);
// Use a standalone AppleScript file for Finder comment copying
var scriptContent = 'tell application "Finder"\n' +
' set sourceFile to POSIX file "' + fileFrom.fsName.replace(/\\/g, "\\\\").replace(/"/g, "\\\"") + '" as alias\n' +
' set destFile to POSIX file "' + fileTo.fsName.replace(/\\/g, "\\\\").replace(/"/g, "\\\"") + '" as alias\n' +
' set commentText to comment of sourceFile\n' +
' if commentText is not "" then\n' +
' set comment of destFile to commentText\n' +
' end if\n' +
'end tell';
// Create a temporary AppleScript file
var scriptFile = new File("/tmp/copy_comment.applescript");
scriptFile.encoding = "UTF-8";
scriptFile.open("w");
scriptFile.write(scriptContent);
scriptFile.close();
// Execute the script with proper permissions
app.system("osascript /tmp/copy_comment.applescript");
// Clean up
app.system("rm /tmp/copy_comment.applescript");
} else if (File.fs == "Windows") {
command = "copy \"" + fileFrom.fsName + "\" \"" + fileTo.fsName + "\"";
app.system(command);
}
if (fileTo.exists) {
return true;
} else {
return false;
}
}
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 10, 2025
02:27 AM
1 Upvote
Mar 10, 2025
02:27 AM
1 Upvote
@noah_7511 wrote:
Hi all! This is something I've been trying to brute force on my own by frankenstiening older posted scripts, but my lack of scripting know-how is really getting in the way.
For context, my work requires me to manually open a large amount of photos, then use 'Open in explore' to then copy its file name, THEN to find it in another folder by using the windows search bar to copy it to a final folder location. And this is PER image.
As you might be able to tell, this take a considerate amount of time for a task that could be automated.
This could be scripted, i.e. the selection of the output folder, then the script copying the open files to the folder.
EDIT: At a basic level, something like this native JS .copy command. It's assumed that the files are saved and ready to copy.
/*
Copy open files in Photoshop to a destination folder.jsx
Stephen Marsh
v1.0 - 10th March 2025
https://community.adobe.com/t5/photoshop-ecosystem-discussions/script-to-copy-the-name-of-multiple-open-documents-to-a-single-text-file/td-p/15201067
*/
#target photoshop
var destinationFolder = selectDestinationFolder();
var openDocs = app.documents.length;
var counter = 0;
// Loop over all open documents
for (var i = 0; i < app.documents.length; i++) {
var doc = app.documents[i];
var docPath = doc.fullName.fsName; // Get the full path of the document in the OS-specific format
//alert(docPath);
copyFile(docPath, destinationFolder.fsName); // Use the OS-specific path of the destination folder
counter++;
}
// End of script notification
app.beep();
alert("Script completed!" + "\r" + "Open document count: " + openDocs + "\n" + "Files copied: " + counter);
function selectDestinationFolder() {
var destinationFolder = Folder.selectDialog("Select the destination folder");
if (destinationFolder == null) {
//alert("No destination folder selected. Script cancelled.");
}
return destinationFolder;
}
function copyFile(sourceFilePath, destinationFolderPath) {
var sourceFile = new File(sourceFilePath);
var destinationFile = new File(destinationFolderPath + "/" + sourceFile.name);
sourceFile.copy(destinationFile);
}
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 10, 2025
02:23 AM
1 Upvote
Mar 10, 2025
02:23 AM
1 Upvote
I would use Camera Raw to change them but it doesn't live preview layers below the current one...
By @Oneechan69
How about selecting the layers and converting them to a smart object, then using the Camera Raw filter as a smart filter.
... View more