Ghoul Fool
Engaged
Ghoul Fool
Engaged
Activity
Jun 11, 2024
08:46 AM
1 Upvote
External recordkeeping, you would be saving this info independently anyway. Photoshop does some logging but you'd have to look at the various log files to see what they contain.
... View more
May 17, 2024
11:07 AM
1 Upvote
I think that this is impossible. You can try changing the finished script so that it does not use fore(back)groundColor.
... View more
Community Expert
in Photoshop Developers Discussions
Apr 04, 2024
08:03 AM
1 Upvote
Apr 04, 2024
08:03 AM
1 Upvote
Filtering for »inToolBar« »true« I get 69 Tools.
... View more
Mar 30, 2024
08:40 AM
[EDIT]
[ script removed as it is not relevant to illustrator ]
[ post again if you have an actual Illustrator Scripting question ]
... View more
Mar 25, 2024
03:23 AM
1 Upvote
All the the scripts I've done for Photoshop over the years I've never needed to access brushes... until now: // select brush by name
var idslct = charIDToTypeID( "slct" );
var desc577 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref311 = new ActionReference();
var idBrsh = charIDToTypeID( "Brsh" );
ref311.putName( idBrsh, "my fancy synthetic brush #4" ); //brush name
desc577.putReference( idnull, ref311 );
executeAction( idslct, desc577, DialogModes.NO ); So far so good, this will select a brush where "my fancy synthetic brush #4" is the name of the required brush. Nice. I'd like to know: Does Photoshop seem to ignore brush folder names?? And If there are two or more brushes named the same (accidental duplicate) does it take the first one??
... View more
Mar 18, 2024
04:58 AM
1 Upvote
I'm probabaly working on a (legacy) practice that in order to perform a function on a layer you had to make it active first. - Also running a function that toggles the layer after just toggling really confuses matters - 😄
... View more
Mar 04, 2024
05:53 AM
3 Upvotes
Anyone know why a small white border would appear on a PSD whilst working on it??? Might be a video card thing; might be a "feature". It does not reappear when you create Window --> New window see screenshot. Image on left (new window) image on right with small white border around canvas both are 128 x 128 image filled with blue pixels - nothing else It is not a set pixel border as it remains the same size when you zoom in/out.
... View more
Feb 23, 2024
08:04 AM
I've not re-booted but had to restart Indesign, (obviously) and reused my original script - which worked fine - no crash. Weird.
... View more
Community Expert
in Photoshop ecosystem Discussions
Feb 15, 2024
07:49 AM
1 Upvote
Feb 15, 2024
07:49 AM
1 Upvote
I am afraid the »checked«-property was introduced after that version, so in that Photoshop-version this approach is not applicable.
... View more
Feb 10, 2024
01:18 AM
I'm glad you find it curious too! There's no explicit unit set up in the script - as I use pixels so assume that's been set and not changed. Secondly, the images size is an odd 200 dpi, 256 x 224 pixels (w & h) Thirrdly resizing the image to 72 dpi, 256 x 224 pixels (w & h) - the script works fine.
... View more
Feb 02, 2024
12:42 AM
1 Upvote
Hey There might be a proper API Photoshop one for it, but I didn't find it, so I have this > inline std::string wstringToString(const std::wstring &wstr) {
std::string str;
str.reserve(wstr.length());
for (const auto &wchar: wstr) {
if (wchar <= 0x7f) {
str.push_back(static_cast<char>(wchar));
} else if (wchar <= 0x7ff) {
str.push_back(static_cast<char>((wchar >> 6) | 0xc0));
str.push_back(static_cast<char>((wchar & 0x3f) | 0x80));
} else if (wchar <= 0xffff) {
if (wchar >= 0xD800 && wchar <= 0xDFFF) {
// Surrogate pair values are invalid in UTF-32
//throw std::invalid_argument("Invalid wide character in input");
continue;
}
str.push_back(static_cast<char>((wchar >> 12) | 0xe0));
str.push_back(static_cast<char>(((wchar >> 6) & 0x3f) | 0x80));
str.push_back(static_cast<char>((wchar & 0x3f) | 0x80));
} else if (wchar <= 0x10ffff) {
str.push_back(static_cast<char>((wchar >> 18) | 0xf0));
str.push_back(static_cast<char>(((wchar >> 12) & 0x3f) | 0x80));
str.push_back(static_cast<char>(((wchar >> 6) & 0x3f) | 0x80));
str.push_back(static_cast<char>((wchar & 0x3f) | 0x80));
} else {
// Code points above 0x10ffff are invalid in Unicode
}
}
return str;
}
... View more
Jan 31, 2024
06:37 AM
2 Upvotes
You can't on Windows. Using the folder select dialog doesn't show files (it does on Mac.) var a = new File('~/Desktop').openDlg('Select', '*.png');
var b = a.parent;
var c = b.getFiles('*.png'); var a = Folder.selectDialog();
var c = a.getFiles('*.png')
... View more
Community Expert
in Photoshop ecosystem Discussions
Jan 08, 2024
03:44 PM
1 Upvote
Jan 08, 2024
03:44 PM
1 Upvote
I have seen this in the documentation, however, I don't recall seeing any scripts using Batch before!
EDIT:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/how-to-run-photoshop-batch-via-javascript-vs-manually-selecting-all-attributes/m-p/14347697#M774613
... View more
Nov 24, 2023
11:45 AM
2 Upvotes
Links panel also has "Actual PPI", "Effective PPI", "Scale", "Skew" ... See the flyout menu >> Panel Options ...
... View more
Nov 23, 2023
04:28 AM
1 Upvote
And if anyone is after those elusive magic numbers then this will help: var myShapeOperation = "Subtract Front Shape";
var myShapeID = get_shape_operation_numbers(myShapeOperation);
//alert(myShapeID)
change_selected_path_shape_operation(myShapeID);
alert(myShapeOperation);
function get_shape_operation_numbers(str)
{
var num;
switch (str)
{
case "Combine Shapes":
num = 1097098272; // phEnumAdd -> 1097098272 -> "Add " add
break;
case "Subtract Front Shape":
num = 1398961266; // phEnumSubtract -> 1398961266 -> "Sbtr" subtract
break;
case "Intersect Shape Areas":
num = 1231975538; // phEventIntersect -> 1231975538 -> "Intr" interfaceIconFrameDimmed
break;
case "Exclude Overlapping Shapes":
num = 1231975511; // phEventIntersectWith -> 1231975511 -> "IntW" interfaceWhite
break;
default:
num = 1097098272;
}
return num;
}
... View more
Nov 15, 2023
09:26 AM
@Ghoul Fool
I've moved your post from the Developers forum to Photoshop > Scripting
Jane
... View more
Aug 18, 2023
02:53 AM
@Stephen Marsh That's my exact thoughts - although the script alone doesn't seem to change the image size interpolation as you would expect. I've not tried that with the Events Manager as I'm not sure if that would make a difference. I'll keep experimenting.
... View more
Community Expert
in Photoshop ecosystem Discussions
Aug 01, 2023
06:32 AM
1 Upvote
Aug 01, 2023
06:32 AM
1 Upvote
It must have worked at one time, who knows how long it's been broken?
... View more
Community Expert
in Photoshop ecosystem Discussions
Jul 24, 2023
03:10 AM
1 Upvote
Jul 24, 2023
03:10 AM
1 Upvote
https://community.adobe.com/t5/photoshop/複数のアンカーポイントのハンドルをリセットする方法/m-p/11157853?page=1#M334200
Edit:
... View more
Community Expert
in Photoshop ecosystem Discussions
Jul 20, 2023
01:29 AM
1 Upvote
Jul 20, 2023
01:29 AM
1 Upvote
//copy contents of the mask
//paste said contents to new document
var saveFile= File(oldPath +"/textures/" +basename +"_" +newname +"_mask.png");
SavePNG(saveFile);
By @Michael Gros
To save an active layer with a layer mask to PNG:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/trouble-with-photoshop-layer-masks/td-p/12698065
... View more
Jul 13, 2023
01:23 AM
Good one!
... View more
Community Expert
in Photoshop ecosystem Discussions
Jun 19, 2023
03:57 PM
1 Upvote
Jun 19, 2023
03:57 PM
1 Upvote
Also by getting layer by name (and making it the activeLayer) it automatically swiches the visibility to on!
By @Ghoul Fool
Yes, AM code to the rescue!
selectLayerName("Layer 1”);
function selectLayerName(lyrName) {
var idselect = stringIDToTypeID("select");
var desc266 = new ActionDescriptor();
var idnull = stringIDToTypeID("null");
var ref59 = new ActionReference();
var idlayer = stringIDToTypeID("layer");
ref59.putName(idlayer, lyrName);
desc266.putReference(idnull, ref59);
var idmakeVisible = stringIDToTypeID("makeVisible");
desc266.putBoolean(idmakeVisible, false);
var idlayerID = stringIDToTypeID("layerID");
var list41 = new ActionList();
list41.putInteger(3);
desc266.putList(idlayerID, list41);
executeAction(idselect, desc266, DialogModes.NO);
}
... View more
Jun 09, 2023
08:34 PM
I do not understand why is not so straight fordward, and why is so difficult
By @AlexPrint
The previous code offerings were simple AM recordings of standard relative keyboard shortcuts that would be used in an action. This is why they are complex.
Update: There is another, simpler way to move the active layer to the back/bottom, using standard DOM code rather than AM code:
// Move the active layer to the bottom layer in the stack
activeDocument.activeLayer.move(activeDocument.layers[activeDocument.layers.length - 1], ElementPlacement.PLACEAFTER);
Or to the front/top:
// Move the active layer to the top layer in the stack
activeDocument.activeLayer.move(activeDocument.layers[0], ElementPlacement.PLACEBEFORE);
... View more
Community Expert
in Photoshop ecosystem Discussions
Mar 21, 2023
01:58 PM
1 Upvote
Mar 21, 2023
01:58 PM
1 Upvote
A couple of related topics:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/how-to-check-layer-kind-using-javascript/m-p/13174707
https://community.adobe.com/t5/photoshop-ecosystem-discussions/select-only-the-text-layers/m-p/11017397
... View more
Mar 10, 2023
03:29 AM
3 Upvotes
Hi @Ghoul Fool , If you are looking for a placed image’s file name it would be the name of the itemLink, and frameFittingOptions are a property of the container:
var g = app.activeDocument.allGraphics;
for (var i = 0; i < g.length; i++){
$.writeln(g[i].itemLink.name)
//returns the placed file’s name
$.writeln(g[i].parent.frameFittingOptions.topCrop)
//frameFittingOptions are a property of the graphic’s container—its parent
}
Also, you could simplify the is cropped test by comparing the image bounds with its parent’s bounds, if they are not the same fit the frame to content (this would also fit a parent frame that’s larger than the image):
var g = app.activeDocument.allGraphics;
for (var i = 0; i < g.length; i++){
if (g[i].geometricBounds.toString() != g[i].parent.geometricBounds.toString()) {
$.writeln("Image frame is not fit")
g[i].parent.fit(FitOptions.FRAME_TO_CONTENT)
}
}
... View more
Mar 08, 2023
09:33 AM
1 Upvote
That make more sense! 🙂
... View more
Feb 27, 2023
04:32 PM
1 Upvote
The location is same as you mentioned but i tried again and again nothing worked , atlast i reinstalled the window 10 and reinstall the photoshop software again then place the plugin in your mentioned path, and luckily it worked.
... View more
Feb 26, 2023
02:05 AM
1 Upvote
It's probably one of those idiosyncracies that only someone at Adobe might answer, and even more possibly someone from the developping team. So if one of them is passing by, all we can do is wave at them very hard 😉
... View more