gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
write me after effects script that edits the layer text
- User
write me after effects script that edits the layer text
- Assistant
Certainly! Here's a script that edits the text content of a selected layer in After Effects:
// Check if a layer is selected if (app.project.activeItem && app.project.activeItem instanceof CompItem && app.project.activeItem.selectedLayers.length > 0) { var selectedLayer = app.project.activeItem.selectedLayers[0]; // Get the first selected layer if (selectedLayer instanceof TextLayer) { // Check if the selected layer is a Text layer // Prompt the user for new text content var newTextContent = prompt("Enter the new text content:", selectedLayer.text.sourceText.value); if (newTextContent !== null) { // Check if the user clicked "OK" or entered a value // Change the selected layer's text content app.beginUndoGroup("Edit Text Layer"); selectedLayer.text.sourceText.setValue(newTextContent); app.endUndoGroup(); } else { alert("No changes were made."); // Display a message if the user clicked "Cancel" } } else { alert("Please select a text layer."); // Display a message if the selected layer is not a Text layer } } else { alert("Please select a layer."); // Display a message if no layer is selected }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.