/t5/photoshop-ecosystem-ideas/action-condition-pour-objet-dynamique/idi-p/14918829Oct 15, 2024
Oct 15, 2024
Copy link to clipboard
Copied
Hello Hello,
Dans les "Actions", ce serait intéressant de rajouter une condition " si le calque est un objet dynamique", cela permettrait de pouvoir l'éditer, le pixeliser, choisir une composition de calque....
//////////////////////////////////////////
// Script Name: Conditionals - Run Action If Active Layer is an Embedded Smart Object Layer.jsx
// Version: 1.0
// Author: Stephen Marsh
// Usage: Runs a named Action if the active layer is an embedded smart object layer
//////////////////////////////////////////
#target photoshop
if (app.a
//////////////////////////////////////////
// Script Name: Conditionals - Run Action If Active Layer is a Smart Object Layer.jsx
// Version: 1.0
// Author: Stephen Marsh
// Usage: Runs a named Action if the active layer is a smart object layer
//////////////////////////////////////////
#target photoshop
if (app.activeDocument.activeLayer.kind === LayerKind.SMARTOBJECT) {
// Change the Action and Action Set name as required
app.doAction("Action 1", "Action Set 1");
} else {
// Uncomment the following line and modify the names as required
//app.doAction("Action 1", "Action Set 2");
}
//////////////////////////////////////////
//////////////////////////////////////////
// Script Name: Conditionals - Run Action If Active Layer is an Embedded Smart Object Layer.jsx
// Version: 1.0
// Author: Stephen Marsh
// Usage: Runs a named Action if the active layer is an embedded smart object layer
//////////////////////////////////////////
#target photoshop
if (app.activeDocument.activeLayer.kind === LayerKind.SMARTOBJECT) {
var ref = new ActionReference();
ref.putEnumerated(charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));
var layerDesc = executeActionGet(ref);
ref.putProperty(charIDToTypeID("Prpr"), stringIDToTypeID("smartObject"));
ref.putEnumerated(charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));
var so = executeActionGet(ref).getObjectValue(stringIDToTypeID("smartObject"));
var soMoreDesc = layerDesc.getObjectValue(stringIDToTypeID('smartObjectMore'));
if (so.getBoolean(stringIDToTypeID("linked")) === false) {
// Change the Action and Action Set name as required
app.doAction("Action 1", "Action Set 1");
} else {
// Uncomment the following line and modify the names as required
//app.doAction("Action 1", "Action Set 2");
}
}
//////////////////////////////////////////
//////////////////////////////////////////
// Script Name: Conditionals - Run Action If Active Layer is a Linked Smart Object Layer.jsx
// Version: 1.0
// Author: Stephen Marsh
// Usage: Runs a named Action if the active layer is a linked smart object layer
//////////////////////////////////////////
#target photoshop
if (app.activeDocument.activeLayer.kind === LayerKind.SMARTOBJECT) {
var ref = new ActionReference();
ref.putEnumerated(charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));
var layerDesc = executeActionGet(ref);
ref.putProperty(charIDToTypeID("Prpr"), stringIDToTypeID("smartObject"));
ref.putEnumerated(charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));
var so = executeActionGet(ref).getObjectValue(stringIDToTypeID("smartObject"));
var soMoreDesc = layerDesc.getObjectValue(stringIDToTypeID('smartObjectMore'));
if (so.getBoolean(stringIDToTypeID("linked")) === true) {
// Change the Action and Action Set name as required
app.doAction("Action 1", "Action Set 1");
} else {
// Uncomment the following line and modify the names as required
//app.doAction("Action 1", "Action Set 2");
}
}
//////////////////////////////////////////
//////////////////////////////////////////
// Script Name: Conditionals - Run Action If Active Layer is a Generative Fill Smart Object Layer.jsx
// Version: 1.0
// Author: Stephen Marsh
// Usage: Runs a named Action if the active layer is a generate fill smart object layer
//////////////////////////////////////////
#target photoshop
if (app.activeDocument.activeLayer.kind === LayerKind.SMARTOBJECT) {
var ref = new ActionReference();
ref.putEnumerated(charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));
var layerDesc = executeActionGet(ref);
ref.putProperty(charIDToTypeID("Prpr"), stringIDToTypeID("smartObject"));
ref.putEnumerated(charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));
var so = executeActionGet(ref).getObjectValue(stringIDToTypeID("smartObject"));
var soMoreDesc = layerDesc.getObjectValue(stringIDToTypeID('smartObjectMore'));
if (soMoreDesc.hasKey(stringIDToTypeID('generativeDocInfo')) === true) {
// Change the Action and Action Set name as required
app.doAction("Action 1", "Action Set 1");
} else {
// Uncomment the following line and modify the names as required
//app.doAction("Action 1", "Action Set 2");
}
}
//////////////////////////////////////////
/t5/photoshop-ecosystem-ideas/action-condition-pour-objet-dynamique/idc-p/14920013#M23236Oct 15, 2024
Oct 15, 2024
Copy link to clipboard
Copied
One of the most desired conditions for many is to be able to do things based on pixel dimensions. I have never seen anything similar offered or requested. For example: if the document width is greater than...
/t5/photoshop-ecosystem-ideas/action-condition-pour-objet-dynamique/idc-p/14920060#M23238Oct 15, 2024
Oct 15, 2024
Copy link to clipboard
Copied
One of the most desired conditions for many is to be able to do things based on pixel dimensions. I have never seen anything similar offered or requested. For example: if the document width is greater than...
@Bojan Živković – Agreed it would be fantastic to expand on Conditional Actions by adding the ability to add operators and parameters to them. This would require a new GUI feature so that one could pick an operator or combinations of operators < + * / > = either as symbols or text (greater than etc) and a value "50" or "50px" or another operand such as Document Width, Document Height etc.
Such would bring the basic power of scripting in a limited form to the masses! This was the whole idea of starting the Photoshop Action Helper Scripts...