
Stephen Marsh
Community Expert
Stephen Marsh
Community Expert
Activity
Mar 09, 2025
05:18 PM
I have no idea which script you are using, there were multiples posted in this topic. Perhaps it's time to try a different script, there are many on the forum to be found via a search.
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 09, 2025
05:14 PM
1 Upvote
Mar 09, 2025
05:14 PM
1 Upvote
Thank you for trying!
Looks like I'll need to stick with the confirm prompt and put the onus on the user (not to mention that rewriting this script in UXP isn't possible for me).
... View more
Mar 08, 2025
07:45 PM
Works perfectly, I use this quite frequently, Thanks!
By @JesseTomi
You're welcome!
As a regular user of the script, do you have any suggestions or requests?
... View more
Mar 08, 2025
06:37 PM
Thank you it works!
By @Christian37649906skks
You're welcome and thank you for taking the time to post feedback!
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 08, 2025
06:24 PM
1 Upvote
Mar 08, 2025
06:24 PM
1 Upvote
@Stephen Marsh Thank you so much! I replaced those 5 lines and it has fixed part of the problem. The Glow Size and Glow Brightness parameters are now being correctly randomized. Unfortunately, the color/RGB values still aren't. Do you know what could be causing this? Is it a CharID to StringID issue or something else?
By @ugonnaa21431338
Here is my code:
var neonGlowRandomSize = Math.floor(Math.random() * 49) - 24; // Range: -24 to 24;
var neonGlowRandomBrightness = Math.floor(Math.random() * 51); // Range: 0-50;
var neonGlowRandomRed = Math.floor(Math.random() * 256);
var neonGlowRandomGreen = Math.floor(Math.random() * 256);
var neonGlowRandomBlue = Math.floor(Math.random() * 256);
applyNeonGlowFilter(neonGlowRandomSize, neonGlowRandomBrightness, neonGlowRandomRed, neonGlowRandomGreen, neonGlowRandomBlue);
function applyNeonGlowFilter(size, brightness, red, green, blue) {
var c2t = function (s) {
return app.charIDToTypeID(s);
};
var s2t = function (s) {
return app.stringIDToTypeID(s);
};
var descriptor = new ActionDescriptor();
var descriptor2 = new ActionDescriptor();
descriptor.putEnumerated(c2t("GEfk"), c2t("GEft"), s2t("neonGlow"));
descriptor.putInteger(s2t("size"), size);
descriptor.putInteger(s2t("brightness"), brightness);
descriptor2.putDouble(s2t("red"), red);
descriptor2.putDouble(s2t("grain"), green);
descriptor2.putDouble(s2t("blue"), blue);
descriptor.putObject(s2t("color"), s2t("RGBColor"), descriptor2);
executeAction(c2t("GEfc"), descriptor, DialogModes.NO);
}
Edit: Sorry, I forgot to tell you to update from:
descriptor.putObject(s2t("Clr "), s2t("RGBC"), colorDescriptor);
to:
descriptor.putObject(s2t("color"), s2t("RGBC"), colorDescriptor);
... View more
Mar 08, 2025
03:14 PM
@ugonnaa21431338
You have done well so far!
I think that the issue is in these 5 lines in your function:
descriptor.putInteger(s2t("Sz "), size); // Randomized Glow Size
descriptor.putInteger(s2t("Brgh"), brightness); // Randomized Glow Brightness var colorDescriptor = new ActionDescriptor();
colorDescriptor.putInteger(s2t("Rd "), red);
colorDescriptor.putInteger(s2t("Grn "), green);
colorDescriptor.putInteger(s2t("Bl "), blue);
Which should be:
descriptor.putInteger(s2t("size"), size); // Randomized Glow Size
descriptor.putInteger(s2t("brightness"), brightness); // Randomized Glow Brightness colorDescriptor.putInteger(s2t("red"), red);
colorDescriptor.putInteger(s2t("grain"), green);
colorDescriptor.putInteger(s2t("blue"), blue);
The issue is that you haven't converted the charID's to the expected stringID's. I created a couple of scripts to convert between these here (don't input the quote marks):
https://community.adobe.com/t5/photoshop-ecosystem-discussions/action-manager-scripting/td-p/11160326
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 08, 2025
01:53 PM
4 Upvotes
Mar 08, 2025
01:53 PM
4 Upvotes
Alpha channels are greyscale, ranging from white to black with grey values in between.
Spot channels are a special type of alpha channel. As they are for print production, they use a subtractive colour model, where white = 0% and black = 100%.
Colour values are assigned to the spot channel via it's properties rather than by using a colour swatch or mixer values as would normally be the case for RGB/CMYK/Lab colour pixels.
There's a lot of room for error with spot channels if you're new to them.
What are you doing and where and how will the spot channel be used?
https://helpx.adobe.com/au/photoshop/using/channel-basics.html
https://helpx.adobe.com/au/photoshop/using/printing-spot-colors.html
... View more
Mar 08, 2025
04:15 AM
That's great! It reminds me of AppleScript having the ability to either run JSX "inline" or by calling an external JSX file to accomplish tasks outside of the AS DOM.
... View more
Mar 08, 2025
03:01 AM
Here's a slightly different take on the previous script, this one leverages colour range to load all pure black pixels as a selection and then compares the selection width to the document width. If both match, then the file is logged as possibly containing a black row. As with the previous code, this isn't perfect and there may be cases where false positives are flagged.
/*
Log Files With Black Full Width Line to Text File Slower.jsx
Stephen Marsh
v1.0 - 8th March 2025
https://community.adobe.com/t5/photoshop-ecosystem-discussions/black-horizontal-line-across-the-image-after-save-to-tif/m-p/15195817
*/
#target photoshop
// Open dialog to select files
var theFiles = File.openDialog("Select files to check for full width 0r0g0b pixels", true);
if (theFiles) {
processFiles(theFiles);
} else {
alert("No files selected.");
}
// Function to check histogram for 0r0g0b
function checkHistogramForBlack(doc) {
var histo = doc.histogram;
return histo[0] > 0;
}
function selectColorRange(fuzziness, luminance, a, b, luminance2, a2, b2, colorModel) {
var s2t = function (s) {
return app.stringIDToTypeID(s);
};
var descriptor = new ActionDescriptor();
var descriptor2 = new ActionDescriptor();
var descriptor3 = new ActionDescriptor();
descriptor.putInteger(s2t("fuzziness"), fuzziness);
descriptor2.putDouble(s2t("luminance"), luminance);
descriptor2.putDouble(s2t("a"), a);
descriptor2.putDouble(s2t("b"), b);
descriptor.putObject(s2t("minimum"), s2t("labColor"), descriptor2);
descriptor3.putDouble(s2t("luminance"), luminance2);
descriptor3.putDouble(s2t("a"), a2);
descriptor3.putDouble(s2t("b"), b2);
descriptor.putObject(s2t("maximum"), s2t("labColor"), descriptor3);
descriptor.putInteger(s2t("colorModel"), colorModel);
executeAction(s2t("colorRange"), descriptor, DialogModes.NO);
}
function processFiles(theFiles) {
var resultFile = new File(Folder.desktop + "/BlackPixelsCheckResults.txt");
resultFile.open("w");
resultFile.writeln("Files possibly containing full width 0r0g0b pixels:\n");
// Counter for files with 0r0g0b pixels
var blackFilesCount = 0;
// Loop through files
for (var i = 0; i < theFiles.length; i++) {
var theFile = theFiles[i];
var doc = app.open(theFile);
selectColorRange(0, 0, 0, 0, 0, 0, 0, 0);
var selectionBounds = activeDocument.selection.bounds;
var selectionWidth = selectionBounds[2].as("px") - selectionBounds[0].as("px");
if (app.activeDocument.width.as("px") === selectionWidth) {
resultFile.writeln(theFile.fsName);
blackFilesCount++; // Increment counter when 0r0g0b pixels are found
}
doc.close(SaveOptions.DONOTSAVECHANGES);
}
// End of script notification
resultFile.close();
alert("Processing complete!\n" + "Total files checked: " + theFiles.length + "\n" +
"Files with possible full width black pixels: " + blackFilesCount + "\n" +
"Results saved to: " + resultFile.fsName);
resultFile.execute();
}
... View more
Mar 07, 2025
08:35 PM
@William35585738b0s9
You’re welcome! The official guide could use more examples, I think that they tried to keep it simple:
https://helpx.adobe.com/au/photoshop/using/creating-data-driven-graphics.html
... View more
Mar 07, 2025
07:59 PM
You have 5 variables in the CSV, but only 4 text are defined in the PSD, the pixel replacement isn't defined.
Additionally, there are visibility variables for each text layer in the PSD, so a column would also be needed for that with boolean values.
I have tested with both the standard PSD data set export and exporting direct to JPEG, WEBP etc:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/using-datasets/td-p/2665594/page/2#U15189770
... View more
Mar 07, 2025
06:52 PM
Please share the CSV and PSD.
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 07, 2025
05:49 PM
2 Upvotes
Mar 07, 2025
05:49 PM
2 Upvotes
A team effort then!
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 07, 2025
04:23 PM
3 Upvotes
Mar 07, 2025
04:23 PM
3 Upvotes
Sounds like the global light is active.
https://helpx.adobe.com/au/photoshop/using/layer-effects-styles.html
... View more
Mar 07, 2025
03:20 PM
Adobe need to update all of their old .JSX scripts for. .PSJS or UXP panels. I believe it's one technology or the other as they can't be mixed.
... View more
Mar 07, 2025
03:17 PM
@anthony_8099
It works for me. Try downloading the full archive:
https://github.com/MarshySwamp/JJMack-Archive/
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 07, 2025
05:02 AM
2 Upvotes
Mar 07, 2025
05:02 AM
2 Upvotes
Many thanks to you and Pfaffenbichler! You are the best :heart_suit:
By @Innotex Nico Tanne
You're welcome, the critical part came from @c.pfaffenbichler
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 07, 2025
05:01 AM
1 Upvote
Mar 07, 2025
05:01 AM
1 Upvote
Thanks for your quick reply, but unfortunately smartObject.appliedSmartFilters seems to be no longer available and is undefined 😞
By @Innotex Nico Tanne
It never was, it's an AI hallucination/invention.
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 07, 2025
04:30 AM
1 Upvote
Mar 07, 2025
04:30 AM
1 Upvote
@jasper_7571
We need to generate these files programmatically without opening Photoshop.
I can only comment on ExtendScript/JavaScript. As the scripting host environment, Photoshop has to be open to execute the script.
The creation of a path from a selection created from an alpha channel is certainly possible, however, the quality of the path is another story.
Same for saving as a Photoshop EPS, that is easy enough.
Is there a reason why you need an old-school clipping path and EPS file? Why can't you use raster transparency and a modern file format such as PSD or PDF?
Here's an example script for creating paths from alphas:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/script-get-pathpoint-from-channel-selection/m-p/13968783
You can use DOM code to set a path as a clipping path:
https://theiviaxx.github.io/photoshop-docs/Photoshop/PathItem/makeClippingPath.html
Or you can use AM code:
setClippingPath(2);
function setClippingPath(flatness) {
var s2t = function (s) {
return app.stringIDToTypeID(s);
};
var descriptor = new ActionDescriptor();
var descriptor2 = new ActionDescriptor();
var reference = new ActionReference();
var reference2 = new ActionReference();
reference.putProperty( s2t( "path" ), s2t( "clippingPath" ));
descriptor.putReference( s2t( "null" ), reference );
reference2.putEnumerated( s2t( "path" ), s2t( "ordinal" ), s2t( "targetEnum" ));
descriptor2.putReference( s2t( "path" ), reference2 );
descriptor2.putDouble( s2t( "flatness" ), flatness );
descriptor.putObject( s2t( "to" ), s2t( "clippingPathEPS" ), descriptor2 );
executeAction( s2t( "set" ), descriptor, DialogModes.NO );
}
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 07, 2025
04:08 AM
2 Upvotes
Mar 07, 2025
04:08 AM
2 Upvotes
With thanks to @c.pfaffenbichler for the code to get the smart filter count.
if (app.documents.length > 0) {
var doc = app.activeDocument;
if (doc.activeLayer.kind == LayerKind.SMARTOBJECT) {
// Get the number of filters applied to the currently selected layer, by c.pfaffenbichler
var ref = new ActionReference();
ref.putEnumerated(charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));
var layerDesc = executeActionGet(ref);
var soDesc = layerDesc.getObjectValue(stringIDToTypeID('smartObject'));
var soMoreDesc = layerDesc.getObjectValue(stringIDToTypeID('smartObjectMore'));
var filterFXcount = soDesc.getList(stringIDToTypeID('filterFX')).count
// Delete the last filter
var iddelete = stringIDToTypeID("delete");
var desc30193 = new ActionDescriptor();
var idnull = stringIDToTypeID("null");
var ref10120 = new ActionReference();
var idfilterFX = stringIDToTypeID("filterFX");
ref10120.putIndex(idfilterFX, filterFXcount); // The last filter
var idlayer = stringIDToTypeID("layer");
var idordinal = stringIDToTypeID("ordinal");
var idtargetEnum = stringIDToTypeID("targetEnum");
ref10120.putEnumerated(idlayer, idordinal, idtargetEnum);
desc30193.putReference(idnull, ref10120);
executeAction(iddelete, desc30193, DialogModes.NO);
} else {
alert("Please select a smart object layer.");
}
} else {
alert("Please open a document first.");
}
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 07, 2025
02:22 AM
1 Upvote
Mar 07, 2025
02:22 AM
1 Upvote
@Innotex Nico Tanne
Here is the raw action manager recording to delete a specific index number filter, unlike many scripting index number which start at zero, this starts at 1, which makes it easy to delete a specific smart filter (in this example, the 2nd filter)..
That's the easy bit. The challenge is working out the length of the idfilterFX index.
var iddelete = stringIDToTypeID( "delete" );
var desc30193 = new ActionDescriptor();
var idnull = stringIDToTypeID( "null" );
var ref10120 = new ActionReference();
var idfilterFX = stringIDToTypeID( "filterFX" );
ref10120.putIndex( idfilterFX, 2 ); // Index # starting at 1
var idlayer = stringIDToTypeID( "layer" );
var idordinal = stringIDToTypeID( "ordinal" );
var idtargetEnum = stringIDToTypeID( "targetEnum" );
ref10120.putEnumerated( idlayer, idordinal, idtargetEnum );
desc30193.putReference( idnull, ref10120 );
executeAction( iddelete, desc30193, DialogModes.NO );
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 06, 2025
11:57 PM
1 Upvote
Mar 06, 2025
11:57 PM
1 Upvote
@c.pfaffenbichler - Thank you for your time, I appreciate that this is a rather esoteric niche for scripting.
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 06, 2025
11:05 PM
1 Upvote
Mar 06, 2025
11:05 PM
1 Upvote
Sample files are helpful.
Will Illustrator be available, or are you looking for a solution without Illustrator?
... View more
Mar 06, 2025
04:13 PM
Apart from using Adobe Bridge or another visual method to eyeball the results, it's possible to script this to various degrees. The following script will check selected files for pure black pixels and write the suspect file names and paths to a text file on the desktop. For processing speed, it will make a temporary crop of the canvas width to 3px wide before checking the histogram, which may not always be perfect and could lead to some false-positives being reported. Checking row by row for continuous black pixels would be very time prohibitive, even if downsampling and/or cropping to help speed things up.
/*
Log Files With Black Full Width Line to Text File Fast.jsx
Stephen Marsh
v1.0 - 7th March 2025
https://community.adobe.com/t5/photoshop-ecosystem-discussions/black-horizontal-line-across-the-image-after-save-to-tif/m-p/15195817
Note: It is assumed that the documents are RGB mode
*/
#target photoshop
// Open dialog to select files
var theFiles = File.openDialog("Select files to check for full width 0r0g0b pixels", true);
if (theFiles) {
processFiles(theFiles);
} else {
alert("No files selected.");
}
// Function to check histogram for 0r0g0b
function checkHistogramForBlack(doc) {
var histo = doc.histogram;
return histo[0] > 0;
}
// Function to process files
function processFiles(theFiles) {
var resultFile = new File(Folder.desktop + "/BlackPixelsCheckResults.txt");
resultFile.open("w");
resultFile.writeln("Files possibly containing full width 0r0g0b pixels:\n");
// Counter for files with 0r0g0b pixels
var blackFilesCount = 0;
// Loop through files
for (var i = 0; i < theFiles.length; i++) {
var theFile = theFiles[i];
var doc = app.open(theFile);
// Resize canvas to 3px wide, yes it's a hack but it works much faster than looping through all pixels...
// Some edge cases could be falsely logged, but it's probably good enough for most cases!
doc.resizeCanvas(UnitValue(3, "px"), doc.height, AnchorPosition.MIDDLECENTER);
if (checkHistogramForBlack(doc)) {
resultFile.writeln(theFile.fsName);
blackFilesCount++; // Increment counter when 0r0g0b pixels are found
}
doc.close(SaveOptions.DONOTSAVECHANGES);
}
// End of script notification
resultFile.close();
alert("Processing complete!\n" + "Total files checked: " + theFiles.length + "\n" +
"Files with possible full width black pixels: " + blackFilesCount + "\n" +
"Results saved to: " + resultFile.fsName);
resultFile.execute();
}
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
Community Expert
in Photoshop ecosystem Discussions
Mar 06, 2025
12:59 PM
1 Upvote
Mar 06, 2025
12:59 PM
1 Upvote
does anyone know what charIDToTypeID( "LwCs" ) and charIDToTypeID( "DocI" ) refere to in terms of actions or gui?
By @gerardoc50494125
If TypeID codes are the same as StringID codes, then:
charIDToTypeID( "LwCs" ) = 'lowerCase'
charIDToTypeID( "DocI” ) = 'documentID'
... View more
Mar 06, 2025
12:49 PM
So to copy files back and forth is not really a workable option over time.
By @morten_2325
If you're happy to double check and re-render as necessary, which doesn't sound like a great option over time.
... View more
Mar 06, 2025
12:45 PM
Right. Easier said than done depending on workload and internal storage. Adobe also says "Adobe is not stating that there should be regular problems storing files and working with external hard disks. " Seems like Adobe is trying to have its cake and eat it to. It's almost like saying try Rawtherapee or DXO.
By @Kovich24
I would presume that other software would have the same issue. If not, you have your answer:
1) save locally and move to removable storage
2) save directly to removable storage and be prepared to double check and re-render when necessary
3) use other software if that proves to be problem free or less problematic
... View more
Mar 06, 2025
07:27 AM
@Deborah342639444s96
Scripts can be installed in the application directory - Presets/Scripts. Browsing for a script is just an alternative option. Once installed, a custom keyboard shortcut can be added to the installed script, or an action recording of the script execution can also use an F-key keyboard shortcut.
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html?m=1
If you're working on projects and switching between various open files in each session, then you might find the following script useful:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/scripts-to-save-amp-restore-photoshop-sessions/m-p/14239969#U14946306
... View more
Mar 06, 2025
05:17 AM
Try Saving to the internal drive and then copy it to the external drive.
https://helpx.adobe.com/au/photoshop/kb/networks-removable-media-photoshop.html
... View more
Mar 05, 2025
08:19 PM
I'm still getting an "object is not safe to edit" error.
By @anthony38519375m1bj
Please share the code and sample files.
... View more