duplicate_sequence
Duplicates a sequence in Adobe Premiere Pro with a new name, enabling efficient workflow management and content replication within video editing projects.
Instructions
Creates a copy of an existing sequence with a new name.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| newName | Yes | The name for the new sequence copy | |
| sequenceId | Yes | The ID of the sequence to duplicate |
Implementation Reference
- src/tools/index.ts:936-966 (handler)The handler function that implements the core logic of the 'duplicate_sequence' tool. It generates an ExtendScript that retrieves the original sequence by ID, clones it using Premiere Pro's API, 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:129-132 (schema)Zod input schema defining the required parameters: sequenceId (string) and newName (string). Used for validation in executeTool.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:127-133 (registration)Tool registration in the getAvailableTools() method, defining the tool's name, description, and input schema for discovery by MCP clients.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-457 (registration)Dispatch/registration in the executeTool switch statement, mapping the tool name to the handler function call.case 'duplicate_sequence': return await this.duplicateSequence(args.sequenceId, args.newName);