duplicate_sequence
Copy an existing Premiere Pro sequence to create a new version with a different name for editing variations or backups.
Instructions
Creates a copy of an existing sequence with a new name.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sequenceId | Yes | The ID of the sequence to duplicate | |
| newName | Yes | The name for the new sequence copy |
Implementation Reference
- src/tools/index.ts:936-966 (handler)The handler function for 'duplicate_sequence' tool. It generates an ExtendScript that retrieves the sequence by ID, clones it using originalSeq.clone(), renames the clone, and returns the new sequence ID.private async duplicateSequence(sequenceId: string, newName: string): Promise<any> { const script = ` try { var originalSeq = app.project.getSequenceByID("${sequenceId}"); if (!originalSeq) { JSON.stringify({ success: false, error: "Sequence not found" }); return; } var newSeq = originalSeq.clone(); newSeq.name = "${newName}"; JSON.stringify({ success: true, originalSequenceId: "${sequenceId}", newSequenceId: newSeq.sequenceID, newName: "${newName}" }); } catch (e) { JSON.stringify({ success: false, error: e.toString() }); } `; return await this.bridge.executeScript(script); }
- src/tools/index.ts:127-133 (schema)Defines the input schema using Zod for validating parameters: sequenceId (string) and newName (string). Part of the tool registration in getAvailableTools().name: 'duplicate_sequence', description: 'Creates a copy of an existing sequence with a new name.', inputSchema: z.object({ sequenceId: z.string().describe('The ID of the sequence to duplicate'), newName: z.string().describe('The name for the new sequence copy') }) },
- src/tools/index.ts:456-458 (registration)Registers the tool in the executeTool method's switch statement, mapping the tool name to the duplicateSequence handler.case 'duplicate_sequence': return await this.duplicateSequence(args.sequenceId, args.newName); case 'delete_sequence':