add_transition
Insert a transition between two adjacent clips in Adobe Premiere Pro by specifying clip IDs, transition type, and duration, streamlining video editing workflows.
Instructions
Adds a transition (e.g., cross dissolve) between two adjacent clips on the timeline.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clipId1 | Yes | The ID of the first clip (outgoing) | |
| clipId2 | Yes | The ID of the second clip (incoming) | |
| duration | Yes | The duration of the transition in seconds | |
| transitionName | Yes | The name of the transition to add (e.g., "Cross Dissolve") |
Implementation Reference
- src/tools/index.ts:1282-1324 (handler)The main handler function `addTransition` that executes the tool logic. It generates and runs an ExtendScript via the bridge to add a transition between two specified clips on the same track.private async addTransition(clipId1: string, clipId2: string, transitionName: string, duration: number): Promise<any> { const script = ` try { var clip1 = app.project.getClipByID("${clipId1}"); var clip2 = app.project.getClipByID("${clipId2}"); if (!clip1 || !clip2) { JSON.stringify({ success: false, error: "One or both clips not found" }); return; } var track = clip1.getTrack(); var transition = track.addTransition("${transitionName}", clip1, clip2, ${duration}); if (!transition) { JSON.stringify({ success: false, error: "Failed to add transition" }); return; } JSON.stringify({ success: true, message: "Transition added successfully", transitionName: "${transitionName}", duration: ${duration}, clip1Id: "${clipId1}", clip2Id: "${clipId2}", transitionId: transition.nodeId }); } catch (e) { JSON.stringify({ success: false, error: e.toString() }); } `; return await this.bridge.executeScript(script);
- src/tools/index.ts:209-217 (schema)The input schema definition for the 'add_transition' tool using Zod, specifying parameters for the two clips, transition name, and duration.name: 'add_transition', description: 'Adds a transition (e.g., cross dissolve) between two adjacent clips on the timeline.', inputSchema: z.object({ clipId1: z.string().describe('The ID of the first clip (outgoing)'), clipId2: z.string().describe('The ID of the second clip (incoming)'), transitionName: z.string().describe('The name of the transition to add (e.g., "Cross Dissolve")'), duration: z.number().describe('The duration of the transition in seconds') }) },
- src/tools/index.ts:478-479 (registration)The registration/dispatch case in the `executeTool` switch statement that maps the tool name to its handler method.case 'add_transition': return await this.addTransition(args.clipId1, args.clipId2, args.transitionName, args.duration);