r-bin
People's Champ
r-bin
People's Champ
Activity
Nov 21, 2024
02:52 PM
del
... View more
Nov 19, 2024
03:26 PM
3 Upvotes
This script first executes the code for before_func(). Then it pauses for you to make a selection. Then you must click the "Continue" button and the code for the after_func() will be executed. For example, before_func() makes a copy of the layer, and after_func() executes ctrj+j taking into account your selection. var title = "Pause";
if (!arguments.length)
{
var ok = true;
try { activeDocument; } catch (e) { alert("activeDocument required"); ok = false; }
////////////////////////////////////////
// Tries to delete previously created palettes
// (if the script is called multiple times),
// otherwise a memory leak may occur on new Photoshops (older than CS6).
dlg = Window.find("palette", title);
if (dlg) { dlg = null; }
////////////////////////////////////////
if (ok)
{
var bt = new BridgeTalk();
bt.target = BridgeTalk.appSpecifier;
bt.body = "$.evalFile("+$.fileName.toSource()+")";
bt.send(5);
}
}
else
{
var dlg = new Window("palette", title);
dlg.add("statictext", undefined, "Create some secection and press Continue");
dlg.b = dlg.add("button", undefined, "Continue");
dlg.b.onClick = function()
{
try {
dlg.opacity = 0;
dlg.hide();
after_func();
}
catch (e) { alert(e); }
}
before_func()
dlg.show();
}
////////////////////////////////////////
function before_func()
{
try {
// duplicate current layer
activeDocument.activeLayer = activeDocument.activeLayer.duplicate();
}
catch (e) { alert(e); }
}
////////////////////////////////////////
function after_func()
{
try {
// make ctrl+j with current selection
executeAction(stringIDToTypeID("copyToLayer"), undefined, DialogModes.NO);
}
catch (e) { alert(e); }
}
... View more
Nov 14, 2024
01:59 PM
You have strange questions. Why do you need to return something from the function? Access to the selection is possible through the activeDocument.selection property anywhere in the code. You can return it from the function using the return operator. return activeDocument.selection; To make sure that your code causes a crash, add one more line (with alert) to your function select_rect(activeDocument, 1, 1, 100, 100);
function select_rect(source_img, left, top, right, bottom) {
source_img.selection.select([
[left, top],
[right, top],
[right, bottom],
[left, bottom]
]);
select_rect=source_img.selection;
alert(select_rect);
} ----------------------------------------------------------------------------------------------------- And the answer to your strange question var sel = select_Ellipse(activeDocument, 1,1,150,40,true);
alert(sel);
function select_Ellipse(sourceImg, left,top,right,bottom,antiAlias){
var circleSelection = charIDToTypeID( "setd" );
var descriptor = new ActionDescriptor();
var id71 = charIDToTypeID( "null" );
var ref5 = new ActionReference();
var id72 = charIDToTypeID( "Chnl" );
var id73 = charIDToTypeID( "fsel" );
ref5.putProperty( id72, id73 );
descriptor.putReference( id71, ref5 );
var id74 = charIDToTypeID( "T " );
var desc12 = new ActionDescriptor();
var top1 = charIDToTypeID( "Top " );
var top2 = charIDToTypeID( "#Pxl" );
desc12.putUnitDouble( top1, top2, top );
var left1 = charIDToTypeID( "Left" );
var left2 = charIDToTypeID( "#Pxl" );
desc12.putUnitDouble( left1, left2, left );
var bottom1 = charIDToTypeID( "Btom" );
var bottom2 = charIDToTypeID( "#Pxl" );
desc12.putUnitDouble( bottom1, bottom2, bottom );
var right1 = charIDToTypeID( "Rght" );
var right2 = charIDToTypeID( "#Pxl" );
desc12.putUnitDouble( right1, right2, right );
var id83 = charIDToTypeID( "Elps" );
descriptor.putObject( id74, id83, desc12 );
var id84 = charIDToTypeID( "AntA" );
descriptor.putBoolean( id84, antiAlias );
executeAction(circleSelection, descriptor, DialogModes.NO );
return sourceImg.selection;
}
... View more
Nov 14, 2024
11:46 AM
select_rect=source_img.selection; What is this code for??? You should never do this! It can cause the program to crash.
... View more
Nov 13, 2024
06:12 PM
2 Upvotes
I’m entering unique information into each description field about an image.Luckily I have speech to text so that I don’t have to type out eachdescription, except for fixing all the little mistakes. So right now I havethe F1 key set to open the file info panel, then I have to highlight thedescription field manually Paste in the copied description and then hit thereturn key and then hit command S and command W. Then I can upload theimage to the print on demand site that I’m using. I’m just trying toeliminate the whole left-handed command S command W because I’m developingarthritis in That hand. It would be easier just to set up either an F Keyto initiate an action to OK save and close the file or a one click action. By @dcsimages Try this script and assign F1 to it // pop the file info dialog
var d = new ActionDescriptor();
var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("fileInfo"));
r.putEnumerated(stringIDToTypeID("document"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
d.putReference(stringIDToTypeID("null"), r);
d.putObject(stringIDToTypeID("to"), stringIDToTypeID("fileInfo"), new ActionDescriptor());
executeAction(stringIDToTypeID("set"), d, DialogModes.ALL);
// save and close current document
activeDocument.close(SaveOptions.SAVECHANGES);
... View more
Nov 09, 2024
03:40 PM
You have an infinite (without borders) mask. To fix the situation, do the following. Activate the mask (click on it). Perform an inversion (Ctrl+I). The mask will become white, but also infinite. Then fill the mask with black (menu->edit->fill->black). After that, you can move the mask.
... View more
Nov 08, 2024
08:28 AM
1 Upvote
I don't understand what you mean by "never was a gray channel"? That's what it has always been called, I can't remember a "black" channel ever... By @D Fosse I said that when recording Actions or using ScriptListener, the name "black" is used in the recording and code of ScriptListener, although in the interface it is designated as "Gray". P.S. I actually gave advice to the author of the topic about removing the mask.
... View more
Nov 08, 2024
07:35 AM
2 Upvotes
When recording the Action, try deleting mask after creating the Levels layer. Then make the necessary correction (80, 255). In this case, the Action should record "current channel" and it should work.
... View more
Nov 08, 2024
03:08 AM
2 Upvotes
Maybe I understood what you want var the_name = activeDocument.name;
var files = activeDocument.path.getFiles();
files.sort(sort_func);
function sort_func(a, b)
{
// Sorting will be alphabetical.
// It may differ from the one set in the explorer, especially for names with numbers.
// For exact matching of sorting, you need to write another sorting function.
// Google will help you. )
if (a > b) return 1;
else if (a < b) return -1;
else return 0;
}
// here you can close activeDocument
// activeDocument.close(SaveOptions.DONOTSAVECHANGES);
for (var i = 0; i < files.length; i++)
{
if (files[i].name.toLowerCase() == the_name.toLowerCase())
{
if (i != files.length-1)
{
open(files[i+1]);
break;
}
}
}
if (i == files.length) alert("it was the last file");
... View more
Nov 07, 2024
01:01 PM
3 Upvotes
My opinion is that it's a bug. In the Actions terminology there is no (never was) "gray" channel for grayscale images. There was always a "black" channel. They messed something up in the new Photoshops and now Actions for grayscale files may not work.
... View more
Nov 07, 2024
12:54 PM
2 Upvotes
for windows var cmd = "explorer /select," + activeDocument.fullName.fsName;
system(cmd); May not work with non-English names.
... View more
Oct 09, 2024
03:20 PM
1 Upvote
How so? Both work for me when I change ~/Desktop to say ~/Documents. By @Stephen Marsh \ In Dialog Modes.ALL neither the script nor the similar Action works for me. I think it can't be fixed, because the bug is 100 years old, at least for Windows UPD. But it could be done like this https://community.adobe.com/t5/photoshop-ecosystem-discussions/is-it-possible-to-save-png-file-without-png-format-option-dialogue/m-p/14539586#M798683
... View more
Sep 20, 2024
05:49 PM
1 Upvote
If the text is always a smart object, try this using a copy of the smart object.
... View more
Jul 29, 2024
11:42 AM
1 Upvote
https://community.adobe.com/t5/photoshop-ecosystem-discussions/set-gray-point-in-curves/m-p/12119505
... View more
Jul 26, 2024
09:08 AM
3 Upvotes
When I use the default halftone filter, it consists of dots of all three colors in any area of the photo. But in this photo, the pattern does not consist of dots of all three colors in any area of the image: By @Donald J. Duck Use this filter in Luminocity mode (or apply it to a copy of the layer that is in Luminocity mode).
... View more
Jun 20, 2024
02:36 PM
1 Upvote
Perhaps no one understands what is happening to you. Possibly a problem with the translation. Try replacing the word "included" with "turned on" in the description. )
... View more
Jun 20, 2024
02:32 PM
Hello Sir @r-bin . . . Where should I prepare to change this? By @Thiha31203570tbl0 There is no such setting in my Photoshop. Ask someone else who has such Photoshop to research the "currentToolOptions" settings for this tool.
... View more
Jun 15, 2024
02:41 PM
1 Upvote
Check how the Action recorded using my Photoshop works for you. https://disk.yandex.ru/d/ZPDLn5PNcaaL-Q
... View more
Jun 15, 2024
04:04 AM
1 Upvote
Yes, everything works fine for me. And I also said that I am recording a different channel, not the same as yours. I think this is the reason. Perhaps someone who has the same version can confirm the behavior like yours. If yes, then this is definitely a bug.
... View more
Jun 14, 2024
04:35 PM
1 Upvote
var options = new ActionDescriptor();
var options2 = new ActionDescriptor();
options2.putEnumerated(stringIDToTypeID("cropAspectRatioModeClass"), stringIDToTypeID("cropAspectRatioModeClass"), stringIDToTypeID("pureAspectRatio")); //targetSize, originalProportions, etc...
options2.putDouble(stringIDToTypeID("aspectWidth"), 0);
options2.putDouble(stringIDToTypeID("aspectHeight"), 0);
options2.putDouble(charIDToTypeID("CrWV"), 0);
options2.putDouble(charIDToTypeID("CrHV"), 0);
options2.putInteger(charIDToTypeID("CrWS"), 0);
options2.putInteger(charIDToTypeID("CrHS"), 0);
options2.putInteger(charIDToTypeID("CrRV"), 0);
options2.putInteger(charIDToTypeID("CrRS"), 1);
options2.putInteger(stringIDToTypeID("cropOverlay"), 2);
options2.putInteger(stringIDToTypeID("CropOptionsShowOverlay"), 1);
options2.putInteger(stringIDToTypeID("orientation"), 0);
options2.putInteger(stringIDToTypeID("cropShieldColorMode"), 1);
var c = new ActionDescriptor();
c.putDouble(stringIDToTypeID("red"), 200);
c.putDouble(stringIDToTypeID("green"), 0);
c.putDouble(stringIDToTypeID("blue"), 0);
options2.putObject(stringIDToTypeID("cropColor"), stringIDToTypeID("RGBColor"), c);
options2.putInteger(stringIDToTypeID("cropOpacity"), 75);
options2.putBoolean(stringIDToTypeID("cropAutoLightenShield"), true);
options2.putBoolean(stringIDToTypeID("cropShowShield"), true);
options2.putBoolean(stringIDToTypeID("preview"), false);
options2.putBoolean(stringIDToTypeID("cropAutoCenterCropBox"), true);
options2.putBoolean(stringIDToTypeID("cropShowCroppedArea"), true);
options2.putBoolean(stringIDToTypeID("AutoFillOnCrop"), true);
options2.putBoolean(stringIDToTypeID("hides"), false);
options.putObject(charIDToTypeID("CrpO"), charIDToTypeID("CrOC"), options2);
var r = new ActionReference();
r.putClass(stringIDToTypeID("cropTool"));
var d = new ActionDescriptor();
d.putReference(stringIDToTypeID("null"), r);
d.putObject(stringIDToTypeID("to"), stringIDToTypeID("null"), options);
executeAction(stringIDToTypeID("set"), d, DialogModes.NO);
... View more
Jun 14, 2024
05:47 AM
1 Upvote
Adobe Photoshop Version: 25.9.0 20240516.r.573 296f739 x64 By @Monstrik I don't have this version of Photoshop, so I can neither confirm nor deny. If you want this fixed, create a bug-report .
... View more
Jun 13, 2024
03:36 PM
1 Upvote
What's your version of Photoshop? Could you show which channels are in your "gray" file? Or better yet, attach the original here. It confuses me that you have “gray channel” recorded into your Action. I can only have "current channel" or "black channel" (PS CS6 or PS CC2020) When playing back and trying to correct a non-existent channel, a dialog will appear, regardless of the state of the show dialog checkbox.
... View more
Jun 12, 2024
06:42 AM
2 Upvotes
Try resetting your preferences . This shouldn't happen.
... View more
Jun 01, 2024
04:39 PM
2 Upvotes
The Select->Isolate layers command is scriptable.
... View more
May 31, 2024
04:08 PM
1 Upvote
Try setting the action execution mode to step-by-step or with some delay. Also try using the first command to use something that does not depend on the presence of an open file, for example selecting a brush tool.
... View more
May 31, 2024
03:55 PM
2 Upvotes
Select all red layers, then isolate the layers.
... View more
May 19, 2024
03:07 PM
2 Upvotes
Replace F.writeln(cInfo); with F.write(cInfo);
... View more
May 19, 2024
02:35 PM
Your code doesn't match what you show. Show the complete script code and the contents of the text file and its file name.
... View more