Erreur script
Bonjour,
J'ai créé un script avec Chat GPT pour ajouter une propriété Réduire les tracés (TrimPath), mais cela ne fonctionne pas.
J'obtiens un message : 
Voici le code :
// Check if a shape layer is selected
if (app.project.activeItem instanceof CompItem && app.project.activeItem.selectedLayers.length > 0) {
var selectedLayer = app.project.activeItem.selectedLayers[0];
// Check if the selected layer is a shape layer
if (selectedLayer instanceof ShapeLayer) {
// Create a new shape
var newShape = new Shape();
// Create a trim path
var trimPath = new ShapeTrimPath();
// Add trim path to the shape
newShape.property("ADBE Root Vectors Group").addProperty("ADBE Vector Shape - Group").addProperty(trimPath);
// Add the shape to the layer
selectedLayer.property("ADBE Root Vectors Group").addProperty(newShape);
alert("Trim Paths property added to the selected shape layer.");
} else {
alert("Please select a shape layer.");
}
} else {
alert("Please select a composition and a shape layer.");
}
La ligne 11 correspondrait à : var trimPath = new ShapeTrimPath();
Comme je ne connais rien à ce langage, je ne vois pas enquoi consiste l'erreur.
Quelle serait la bonne syntaxe ?
Merci.
