r-bin
People's Champ
r-bin
People's Champ
Activity
‎Dec 28, 2024
01:32 PM
2 Upvotes
Sorry, I forgot to answer your question. This is a part of my script and the results. var myProp = 'screensSize';
var myString = 'Hello';
var desc = new ActionDescriptor();
app.putCustomOptions(myProp, desc, false);
alert(app.getCustomOptions('screensSize')); // --> [ActionDescriptor] : [count]'0' [typename]'ActionDescriptor'
alert(app.getCustomOptions('screensSize').getString(0)); // --> ERROR 8500 : property doesn't exist I'll try with your links. By @frmorel First, you use getString(), but I don't see putString(). Second, don't use 0 for the key(id) argument. more
... View more
‎Dec 12, 2024
09:43 AM
2 Upvotes
Interesting case. Somehow connected with the fact that there is both a mask and effects on the group. Maybe even a bug. This can be avoided by placing such a group in another one, but without a mask and effects, and then merge it. But no one encourages you not to use smart objects.
... View more
‎Dec 11, 2024
04:36 PM
1 Upvote
If I understood you correctly, try using the confirm() function instead of alert(). It returns (unlike alert) different values ​​when you click on different buttons, including the close button. Depending on the answer, you choose your order of actions further. The description of the function is given in the screenshot.
... View more
‎Dec 11, 2024
06:14 AM
2 Upvotes
Did you write this code yourself or did GPT do it? There is incorrect work with layers and their indexes, that's why there is confusion. Check this code ////////////////////////////////////////////////////////
function get_selected_layers_idx()
{
try {
var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("targetLayers"));
r.putEnumerated(stringIDToTypeID("document"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
try {
var list = executeActionGet(r).getList(stringIDToTypeID("targetLayers"));
}
catch (e)
{
var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("itemIndex"));
r.putEnumerated(stringIDToTypeID("layer"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
return [ executeActionGet(r).getInteger(stringIDToTypeID("itemIndex"))-1 ];
}
var selected_layers = new Array();
for (var i = 0; i < list.count; i++) selected_layers.push(list.getReference(i).getIndex());
return selected_layers;
}
catch (e) { alert(e.message +"\nline:"+e.line); }
}
////////////////////////////////////////////////////////
function get_layer_info(idx)
{
try {
function transform(p, xx, xy, yx, yy, tx, ty)
{
var x = p[0];
var y = p[1];
p[0] = xx * x + yx * y + tx;
p[1] = xy * x + yy * y + ty;
}
var doc = app.activeDocument;
var old_units = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var w = doc.width.value;
var h = doc.height.value;
app.preferences.rulerUnits = old_units;
var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("textKey"));
r.putIndex(stringIDToTypeID("layer"), idx);
var tkey = executeActionGet(r).getObjectValue(stringIDToTypeID("textKey"));
var xx = 1, xy = 0, yx = 0, yy = 1, tx = 0, ty = 0;
if (tkey.hasKey(stringIDToTypeID("transform")))
{
xx = tkey.getObjectValue(stringIDToTypeID("transform")).getDouble(stringIDToTypeID("xx"));
xy = tkey.getObjectValue(stringIDToTypeID("transform")).getDouble(stringIDToTypeID("xy"));
yx = tkey.getObjectValue(stringIDToTypeID("transform")).getDouble(stringIDToTypeID("yx"));
yy = tkey.getObjectValue(stringIDToTypeID("transform")).getDouble(stringIDToTypeID("yy"));
tx = tkey.getObjectValue(stringIDToTypeID("transform")).getDouble(stringIDToTypeID("tx"));
ty = tkey.getObjectValue(stringIDToTypeID("transform")).getDouble(stringIDToTypeID("ty"));
}
var x0 = tkey.getObjectValue(stringIDToTypeID("bounds")).getUnitDoubleValue(stringIDToTypeID("left"));
var y0 = tkey.getObjectValue(stringIDToTypeID("bounds")).getUnitDoubleValue(stringIDToTypeID("top"));
var x1 = tkey.getObjectValue(stringIDToTypeID("bounds")).getUnitDoubleValue(stringIDToTypeID("right"));
var y1 = tkey.getObjectValue(stringIDToTypeID("bounds")).getUnitDoubleValue(stringIDToTypeID("bottom"));
var p1 = [[x0, y0], [x1, y0], [x1, y1], [x0, y1]];
var ch = tkey.getObjectValue(stringIDToTypeID("textClickPoint")).getUnitDoubleValue(stringIDToTypeID("horizontal"));
var cv = tkey.getObjectValue(stringIDToTypeID("textClickPoint")).getUnitDoubleValue(stringIDToTypeID("vertical"));
tx += w * ch / 100;
ty += h * cv / 100;
transform(p1[0], xx, xy, yx, yy, tx, ty);
transform(p1[1], xx, xy, yx, yy, tx, ty);
transform(p1[2], xx, xy, yx, yy, tx, ty);
transform(p1[3], xx, xy, yx, yy, tx, ty);
var l = Math.min(p1[0][0], p1[1][0], p1[2][0], p1[3][0]);
var r = Math.max(p1[0][0], p1[1][0], p1[2][0], p1[3][0]);
var t = Math.min(p1[0][1], p1[1][1], p1[2][1], p1[3][1]);
var b = Math.max(p1[0][1], p1[1][1], p1[2][1], p1[3][1]);
var mid_x = (l + r) / 2;
var mid_y = (t + b) / 2;
var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("name"));
r.putIndex(stringIDToTypeID("layer"), idx);
return [executeActionGet(r).getString(stringIDToTypeID("name")), mid_x, mid_y];
}
catch (e)
{
alert("Error in get_layer_info: " + e.message +"\nline:"+e.line);
}
}
////////////////////////////////////////////////////////
function processSelectedLayers()
{
try {
var doc = app.activeDocument;
// Open file to save results
var desktop = Folder.desktop;
var file = new File(desktop + "/LayerMidXValues.txt");
file.open("w");
// Get active layers
var idx = get_selected_layers_idx();
var n = 0;
try { activeDocument.backgroundLayer } catch (e) { n = 1; }
for (var i = 0; i < idx.length; i++)
{
var info = get_layer_info(idx[i]+n);
// Save to file
file.writeln("Layer Name: " + info[0]);
file.writeln("Mid X: " + info[1].toFixed(2));
file.writeln("Mid Y: " + info[2].toFixed(2));
file.writeln("-----------------------");
// Show alerts for verification
alert("Layer: " + info[0] + "\nMid X: " + info[1].toFixed(2) + "\nMid Y: " + info[2].toFixed(2));
}
// Close file
file.close();
alert("Results saved to LayerMidXValues.txt on desktop.");
}
catch (e)
{
alert("Error in processSelectedLayers: " + e.message +"\nline:"+e.line);
}
}
////////////////////////////////////////////////////////
// Run the script
processSelectedLayers();
... View more
‎Dec 10, 2024
05:31 PM
Your original script does not show on the alert and does not write to the file such words as "layer:" or "Mid X:". You have modernized something there and perhaps there is a problem there. Without your demonstration of the source code that you run, nothing can be said.
... View more
‎Dec 10, 2024
02:56 PM
1 Upvote
The ruler size is affected by the UI font size. It is set in the preferences settings. Perhaps in new Photoshops there is also scaling of the interface as a whole (not sure).
... View more
‎Dec 10, 2024
08:46 AM
1 Upvote
My script starts with the word "try", yours doesn't. Wrap my code (slightly modified) in the function get_text_mid_x_y(idx) { ..... } function get_text_mid_x_y(idx)
{
try
{
function tranform(p, xx, xy, yx, yy, tx, ty)
{
try {
var x = p[0];
var y = p[1];
p[0] = xx*x + yx*y + tx;
p[1] = xy*x + yy*y + ty;
}
catch (e) { alert(e); }
}
var doc = app.activeDocument;
var old_units = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var w = doc.width.value;
var h = doc.height.value;
app.preferences.rulerUnits = old_units;
var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("textKey"));
if (idx >= 1)
r.putIndex(stringIDToTypeID("layer"), idx);
else
r.putEnumerated(stringIDToTypeID("layer"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
var tkey = executeActionGet(r).getObjectValue(stringIDToTypeID("textKey"));
var xx = 1;
var xy = 0;
var yx = 0;
var yy = 1;
var tx = 0;
var ty = 0;
if (tkey.hasKey(stringIDToTypeID("transform")))
{
xx = tkey.getObjectValue(stringIDToTypeID("transform")).getDouble(stringIDToTypeID("xx"));
xy = tkey.getObjectValue(stringIDToTypeID("transform")).getDouble(stringIDToTypeID("xy"));
yx = tkey.getObjectValue(stringIDToTypeID("transform")).getDouble(stringIDToTypeID("yx"));
yy = tkey.getObjectValue(stringIDToTypeID("transform")).getDouble(stringIDToTypeID("yy"));
tx = tkey.getObjectValue(stringIDToTypeID("transform")).getDouble(stringIDToTypeID("tx")); // not used
ty = tkey.getObjectValue(stringIDToTypeID("transform")).getDouble(stringIDToTypeID("ty")); // not used
}
var x0 = tkey.getObjectValue(stringIDToTypeID("bounds")).getUnitDoubleValue(stringIDToTypeID("left"));
var y0 = tkey.getObjectValue(stringIDToTypeID("bounds")).getUnitDoubleValue(stringIDToTypeID("top"));
var x1 = tkey.getObjectValue(stringIDToTypeID("bounds")).getUnitDoubleValue(stringIDToTypeID("right"));
var y1 = tkey.getObjectValue(stringIDToTypeID("bounds")).getUnitDoubleValue(stringIDToTypeID("bottom"));
var p1 = [[x0,y0],[x1,y0],[x1,y1],[x0,y1]];
var ch = tkey.getObjectValue(stringIDToTypeID("textClickPoint")).getUnitDoubleValue(stringIDToTypeID("horizontal"));
var cv = tkey.getObjectValue(stringIDToTypeID("textClickPoint")).getUnitDoubleValue(stringIDToTypeID("vertical"));
tx += w*ch/100;
ty += h*cv/100;
tranform(p1[0], xx, xy, yx, yy, tx, ty);
tranform(p1[1], xx, xy, yx, yy, tx, ty);
tranform(p1[2], xx, xy, yx, yy, tx, ty);
tranform(p1[3], xx, xy, yx, yy, tx, ty);
var l = Math.min(p1[0][0], p1[1][0], p1[2][0], p1[3][0]);
var t = Math.min(p1[0][1], p1[1][1], p1[2][1], p1[3][1]);
var r = Math.max(p1[0][0], p1[1][0], p1[2][0], p1[3][0]);
var b = Math.max(p1[0][1], p1[1][1], p1[2][1], p1[3][1]);
var mid_x = (l+r)/2;
var mid_y = (t+b)/2;
return [mid_x, mid_y];
}
catch (e) { alert(e); }
} In your code, replace the code var theseBounds = [theBounds.getUnitDoubleValue(stringIDToTypeID("left")), theBounds.getUnitDoubleValue(stringIDToTypeID("top"))]; in the first case with var theseBounds = get_text_mid_x_y(theIndex); in the second case with var theseBounds = get_text_mid_x_y(-1); P.S. I haven't checked it, because it won't work on CS6 anyway.
... View more
‎Dec 09, 2024
02:04 PM
2 Upvotes
@c.pfaffenbichler Your script gives me different results than the algorithm I gave in the link. By the way, there was an error with determining the width and height of the document if the resolution is not 72. My script (try it) try
{
function tranform(p, xx, xy, yx, yy, tx, ty)
{
try {
var x = p[0];
var y = p[1];
p[0] = xx*x + yx*y + tx;
p[1] = xy*x + yy*y + ty;
}
catch (e) { alert(e); }
}
var doc = app.activeDocument;
var old_units = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var w = doc.width.value;
var h = doc.height.value;
app.preferences.rulerUnits = old_units;
var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("textKey"));
r.putEnumerated(stringIDToTypeID("layer"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
var tkey = executeActionGet(r).getObjectValue(stringIDToTypeID("textKey"));
var xx = 1;
var xy = 0;
var yx = 0;
var yy = 1;
var tx = 0;
var ty = 0;
if (tkey.hasKey(stringIDToTypeID("transform")))
{
xx = tkey.getObjectValue(stringIDToTypeID("transform")).getDouble(stringIDToTypeID("xx"));
xy = tkey.getObjectValue(stringIDToTypeID("transform")).getDouble(stringIDToTypeID("xy"));
yx = tkey.getObjectValue(stringIDToTypeID("transform")).getDouble(stringIDToTypeID("yx"));
yy = tkey.getObjectValue(stringIDToTypeID("transform")).getDouble(stringIDToTypeID("yy"));
tx = tkey.getObjectValue(stringIDToTypeID("transform")).getDouble(stringIDToTypeID("tx")); // not used
ty = tkey.getObjectValue(stringIDToTypeID("transform")).getDouble(stringIDToTypeID("ty")); // not used
}
var x0 = tkey.getObjectValue(stringIDToTypeID("bounds")).getUnitDoubleValue(stringIDToTypeID("left"));
var y0 = tkey.getObjectValue(stringIDToTypeID("bounds")).getUnitDoubleValue(stringIDToTypeID("top"));
var x1 = tkey.getObjectValue(stringIDToTypeID("bounds")).getUnitDoubleValue(stringIDToTypeID("right"));
var y1 = tkey.getObjectValue(stringIDToTypeID("bounds")).getUnitDoubleValue(stringIDToTypeID("bottom"));
var p1 = [[x0,y0],[x1,y0],[x1,y1],[x0,y1]];
var ch = tkey.getObjectValue(stringIDToTypeID("textClickPoint")).getUnitDoubleValue(stringIDToTypeID("horizontal"));
var cv = tkey.getObjectValue(stringIDToTypeID("textClickPoint")).getUnitDoubleValue(stringIDToTypeID("vertical"));
tx += w*ch/100;
ty += h*cv/100;
tranform(p1[0], xx, xy, yx, yy, tx, ty);
tranform(p1[1], xx, xy, yx, yy, tx, ty);
tranform(p1[2], xx, xy, yx, yy, tx, ty);
tranform(p1[3], xx, xy, yx, yy, tx, ty);
var l = Math.min(p1[0][0], p1[1][0], p1[2][0], p1[3][0]);
var t = Math.min(p1[0][1], p1[1][1], p1[2][1], p1[3][1]);
var r = Math.max(p1[0][0], p1[1][0], p1[2][0], p1[3][0]);
var b = Math.max(p1[0][1], p1[1][1], p1[2][1], p1[3][1]);
var mid_x = (l+r)/2;
var mid_y = (t+b)/2;
alert(mid_x+"\n"+mid_y)
}
catch (e) { alert(e); }
... View more
‎Dec 08, 2024
05:55 AM
1 Upvote
I can't reproduce this (CS6). I remember that on some version of CC (~2020) they started to partially change the algorithms for merging layers and groups. Because of this, some old scripts stopped working correctly.
... View more
‎Dec 08, 2024
04:29 AM
1 Upvote
When you merge a group, you lose (cut off) all the pixels that are outside the canvas. This is the only downside. Converting to a smart object takes longer and can be affected by blurring due to accidental scaling. There may also be problems with non-standard profiles and bit modes.
... View more
‎Dec 07, 2024
04:23 PM
2 Upvotes
How do you verify that it "refuses to apply the sRGB color profile"? ..... BTW - there is no such thing as "plain RGB". There is always some RGB color space. By @D Fosse It looks like there are 32 bit images there
... View more
‎Dec 06, 2024
05:41 PM
2 Upvotes
https://community.adobe.com/t5/photoshop-ecosystem-discussions/how-to-get-text-transform-box-boundary/m-p/11142576
... View more
‎Dec 01, 2024
03:29 AM
1 Upvote
I've updated posted script with it. By @dendenis82 There are a few more parameters that can be passed in the descriptor. If they are missing, they take some default values. You may want to control some of them. UPD. Also, the bat (cmd) file does not need to be stored separately You can create it in a temporary folder using your script, then run it and then delete it.
... View more
‎Nov 30, 2024
06:09 AM
2 Upvotes
Write your command in a bat file and run it instead of app.system() like here .
... View more
‎Nov 30, 2024
05:28 AM
1 Upvote
The previously proposed version can also fail if the figure is too small and shifted from the center to the right and up. The new version is free of this drawback. UPD: improved and accelerated. var doc = activeDocument;
var tmp = "tmp"+Math.random();
var ok = true;
try { doc.selection.bounds; } catch (e) { alert("No selection"); ok = false; }
if (ok)
{
activeDocument.suspendHistory("script", "main()");
}
/////////////////////////////////////////////////
function main()
{
try {
app.preferences.rulerUnits = Units.PIXELS;
save_selection(tmp);
scan(scan());
del_channel(tmp);
doc.guides.add(Direction.VERTICAL, doc.selection.bounds[0])
doc.guides.add(Direction.HORIZONTAL, doc.selection.bounds[1])
}
catch(e) { alert(e.line+"\n"+e); }
}
/////////////////////////////////////////////////
function scan(from)
{
try {
app.preferences.rulerUnits = Units.PIXELS;
load_selection(tmp);
var x0 = doc.selection.bounds[0].value;
var y0 = doc.selection.bounds[1].value;
var x1 = doc.selection.bounds[2].value;
var y1 = doc.selection.bounds[3].value;
var w = x1-x0;
var h = y1-y0;
var safe = 3;
var beg = -w/2-h/2;
var end = w/2+h/2;
var step = 20;
if (from != undefined)
{
beg = from;
end = from+step;
step = 1;
}
for (var off = beg; off <= end; off+=step)
{
load_selection(tmp);
doc.selection.select([[(x0+x1)/2-h/2+off, (y0+y1)/2-h/2-safe], [(x0+x1)/2-h/2+1+off, (y0+y1)/2-h/2-safe], [(x0+x1)/2+h/2+1+off, (y0+y1)/2+h/2+safe], [(x0+x1)/2+h/2+off, (y0+y1)/2+h/2+safe]], SelectionType.INTERSECT, 0, false);
try { doc.selection.bounds; } catch (e) { continue; }
return off-step;
break;
}
}
catch(e) { alert(e.line+"\n"+e); }
}
/////////////////////////////////////////////////
function save_selection(name)
{
try {
var d = new ActionDescriptor();
var r = new ActionReference();
r.putProperty(stringIDToTypeID("channel"), stringIDToTypeID("selection"));
d.putReference(stringIDToTypeID("null"), r);
d.putString(stringIDToTypeID("name"), name);
executeAction(stringIDToTypeID("duplicate"), d, DialogModes.NO);
}
catch(e) { alert(e.line+"\n"+e); }
}
/////////////////////////////////////////////////
function load_selection(name)
{
try {
var d = new ActionDescriptor();
var r = new ActionReference();
r.putProperty(stringIDToTypeID("channel"), stringIDToTypeID("selection"));
d.putReference(stringIDToTypeID("null"), r);
var r1 = new ActionReference();
r1.putName(stringIDToTypeID("channel"), name);
d.putReference(stringIDToTypeID("to"), r1);
executeAction(stringIDToTypeID("set"), d, DialogModes.NO);
}
catch(e) { alert(e.line+"\n"+e); }
}
/////////////////////////////////////////////////
function del_channel(name)
{
try {
var d = new ActionDescriptor();
var r = new ActionReference();
r.putName(stringIDToTypeID("channel"), name);
d.putReference(stringIDToTypeID("null"), r);
executeAction(stringIDToTypeID("delete"), d, DialogModes.NO);
}
catch(e) { alert(e.line+"\n"+e); }
} UPD: improved and accelerated.
... View more
‎Nov 30, 2024
04:11 AM
1 Upvote
The problem may be if the shape is much smaller than the canvas. If I change the canvas size to 8000 instead of the size of your file, I also got an error. To avoid this, replace the line in the code var from = scan(0, w/2, h, 50); with var from = scan(0, Math.min(w,h), h, 50);
... View more
‎Nov 30, 2024
03:46 AM
The large size shouldn't be a problem. I resized your files to 8000 and there is no problem. What error message exactly are you getting?
... View more
‎Nov 29, 2024
05:22 PM
I didn't quite understand what you mean. The script works with the initial selection. You can insert the code to create a selection based on the structure of your files. You know better what's usually inside. I just showed the idea of ​​how to find "protruding" corners. From the lower left corner, a selection of 1 pixel thick is created in the form of a 45-degree line. This selection moves from the edge of the canvas until it touches some corner in the lower left part. Ideally, the contact will be only 1 pixel in size. To find corners in other parts of the figure, you can move the selection from other corners of the canvas to the center. Since you have high-resolution files, to speed up the process, the first movement (scanning) is done with a step of 50 pixels for a rough location of the place where the figure is present in this part. After that, this range (50 pixels) is scanned with a step of 1 pixel to accurately find the extreme pixel of the intersection of the line and the figure. Of course, there may be figures that have several "corners" in a certain frame. The result of the work may be unexpected. You need to look and adapt the script to your "typical" figures, which usually stand vertically and without tilt. Good luck!
... View more
‎Nov 29, 2024
02:36 PM
2 Upvotes
I can only theoretically suggest. Select your adjustment layers and copy them into a new document. You will get a file with only two adjustment layers and no pixel layers. Save and close it. For the files being processed, create such an action. 1. Create a layer and turn it into a smart object. 2. Replace the content with the saved psd file with the correction. 3. Convert the smart object into layers. I can't check the last point, because my Photoshop can't do it. But it seems that the new ones have everything in order with this.
... View more
‎Nov 29, 2024
01:46 PM
1 Upvote
I think about it even in my sleep and dreams. By @mushroom bomb Just a demo. Before running, you need to create a selection from shape. This script finds and selects the lower left corner of the shape as one pixel. It also puts guides on it. Tested on CS6 on the provided tiff file. I have no way to test on CC. var doc = activeDocument;
var tmp = "tmp"+Math.random();
var ok = true;
try { doc.selection.bounds; } catch (e) { alert("No selection"); ok = false; }
if (ok)
{
activeDocument.suspendHistory("script", "main()");
}
///////////////////////////////////////////////////////////////////////////////////////////////////
function main()
{
try {
app.preferences.rulerUnits = Units.PIXELS;
var w = doc.width.value;
var h = doc.height.value;
save_selection(tmp);
var from = scan(0, w/2, h, 50);
scan(from, from+50, h, 1);
del_channel(tmp);
doc.guides.add(Direction.VERTICAL, doc.selection.bounds[0])
doc.guides.add(Direction.HORIZONTAL, doc.selection.bounds[1])
}
catch(e) { alert(e.line+"\n"+e); }
}
///////////////////////////////////////////////////////////////////////////////////////////////////
function scan(from, to, max, step)
{
try {
app.preferences.rulerUnits = Units.PIXELS;
for (var i = from; i <= to; i+=step)
{
load_selection(tmp);
doc.selection.select([[0,max-i], [0,max-i-1], [i+1,max], [i,max]], SelectionType.INTERSECT, 0, false);
try { doc.selection.bounds; } catch (e) { continue; }
break;
}
return i-step;
}
catch(e) { alert(e.line+"\n"+e); }
}
///////////////////////////////////////////////////////////////////////////////////////////////////
function save_selection(name)
{
try {
var d = new ActionDescriptor();
var r = new ActionReference();
r.putProperty(stringIDToTypeID("channel"), stringIDToTypeID("selection"));
d.putReference(stringIDToTypeID("null"), r);
d.putString(stringIDToTypeID("name"), name);
executeAction(stringIDToTypeID("duplicate"), d, DialogModes.NO);
}
catch(e) { alert(e.line+"\n"+e); }
}
///////////////////////////////////////////////////////////////////////////////////////////////////
function load_selection(name)
{
try {
var d = new ActionDescriptor();
var r = new ActionReference();
r.putProperty(stringIDToTypeID("channel"), stringIDToTypeID("selection"));
d.putReference(stringIDToTypeID("null"), r);
var r1 = new ActionReference();
r1.putName(stringIDToTypeID("channel"), name);
d.putReference(stringIDToTypeID("to"), r1);
executeAction(stringIDToTypeID("set"), d, DialogModes.NO);
}
catch(e) { alert(e.line+"\n"+e); }
}
///////////////////////////////////////////////////////////////////////////////////////////////////
function del_channel(name)
{
try {
var d = new ActionDescriptor();
var r = new ActionReference();
r.putName(stringIDToTypeID("channel"), name);
d.putReference(stringIDToTypeID("null"), r);
executeAction(stringIDToTypeID("delete"), d, DialogModes.NO);
}
catch(e) { alert(e.line+"\n"+e); }
}
... View more
‎Nov 29, 2024
10:34 AM
Have you tried loading your old settings through this?
... View more
‎Nov 29, 2024
10:07 AM
Did you have "Temp" as your username? These folders seem to be created by the Camera RAW plugin. What version do you have now? Photoshop CS6 comes with the outdated 7.0. To use dehaze, you must have the latest version available for CS6, i.e. version 9.1.1. The installation file can be downloaded from here https://prodesigntools.com/adobe-cs6-direct-download-links.html
... View more
‎Nov 29, 2024
05:09 AM
As far as I remember, presets are stored in a folder C:\Users\<URESNAME>\AppData\Roaming\Adobe\CameraRaw\Settings where <USERNAME> is your Windows username What is in this folder for you?
... View more
‎Nov 28, 2024
06:18 PM
2 Upvotes
Try this var id = activeDocument.activeLayer.id;
var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("textWarningLevel"));
r.putIdentifier(stringIDToTypeID("layer"), id);
var ret = executeActionGet(r).getInteger(stringIDToTypeID("textWarningLevel"));
alert("Warn = " + ret);
... View more
‎Nov 27, 2024
01:07 PM
1 Upvote
The path isn't highlighted after the selection is made, but you're right, the path is what ends up being deleted. Though that doesn't happen when recording the action. No idea how it switches from deleting the layer information to deleting the path just because of the action. By @Cédric31799117ba43 You can see that the path is specially selected at first "Select path Path1". Then you create a selection. The operation of creating a selection from a path via ctrl+click or via the drop-down menu "Make selection..." deselects the path. This moment (deselection) is not recorded in the action, only the moment of creating the selection. This can lead to the fact that everything can go wrong. Perhaps this behavior is a bug.
... View more
‎Nov 27, 2024
12:24 PM
2 Upvotes
something that might come in handy
... View more
‎Nov 27, 2024
04:45 AM
1 Upvote
If the path is selected (highlighted), then the Delete command will delete the path and not the pixels in the selection. If so, you must insert the Deselect Path command before deleting.
... View more
‎Nov 27, 2024
04:38 AM
If the filter call can be recorded to an Action, then try using that Action to call the filter and assign a key to it.
... View more
‎Nov 22, 2024
01:01 PM
If you have Windows, try changing the priorities of tasks. Photoshop needs to be lowered, the player needs to be raised. How
... View more
‎Nov 22, 2024
12:54 PM
2 Upvotes
Run this code after the code for selecting the desired tool. I can't test its functionality because I'm using an outdated version of PS, on which it doesn't work. try {
var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("tool"));
r.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
var ret = executeActionGet(r);
var options = ret.getObjectValue(stringIDToTypeID("currentToolOptions"));
var tool = ret.getEnumerationType(stringIDToTypeID("tool"));
options.putEnumerated(stringIDToTypeID("mode"), stringIDToTypeID("blendMode"), stringIDToTypeID("darken"));
var r = new ActionReference();
r.putClass(tool);
var d = new ActionDescriptor();
d.putReference(stringIDToTypeID("null"), r);
d.putObject(stringIDToTypeID("to"), stringIDToTypeID("null"), options);
executeAction(stringIDToTypeID("set"), d, DialogModes.NO);
}
catch(e) { alert(e); }
... View more