remove_from_timeline
Remove a clip from the timeline in Adobe Premiere Pro with options to ripple delete (close gap) or lift (leave gap). Simplify video editing workflows through automated clip management.
Instructions
Removes a clip from the timeline.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clipId | Yes | The ID of the clip on the timeline to remove | |
| deleteMode | No | Whether to ripple delete (close gap) or lift (leave gap) |
Implementation Reference
- src/tools/index.ts:1026-1063 (handler)The handler function that executes the removal of a specified clip from the timeline using ExtendScript. It supports 'ripple' (closes gap) or 'lift' (leaves gap) delete modes by calling track.removeClip(clip, boolean). The result is returned as a JSON object via the PremiereProBridge.private async removeFromTimeline(clipId: string, deleteMode = 'ripple'): Promise<any> { const script = ` try { var clip = app.project.getClipByID("${clipId}"); if (!clip) { JSON.stringify({ success: false, error: "Clip not found" }); return; } var clipName = clip.name; var track = clip.getTrack(); if ("${deleteMode}" === "ripple") { track.removeClip(clip, true); // ripple delete } else { track.removeClip(clip, false); // lift delete } JSON.stringify({ success: true, message: "Clip removed from timeline", clipId: "${clipId}", clipName: clipName, deleteMode: "${deleteMode}" }); } catch (e) { JSON.stringify({ success: false, error: e.toString() }); } `; return await this.bridge.executeScript(script); }
- src/tools/index.ts:157-160 (schema)Zod input schema defining the parameters: clipId (required string) and optional deleteMode enum ['ripple', 'lift'].inputSchema: z.object({ clipId: z.string().describe('The ID of the clip on the timeline to remove'), deleteMode: z.enum(['ripple', 'lift']).optional().describe('Whether to ripple delete (close gap) or lift (leave gap)') })
- src/tools/index.ts:154-161 (registration)Tool registration in getAvailableTools() array, including name, description, and input schema.{ name: 'remove_from_timeline', description: 'Removes a clip from the timeline.', inputSchema: z.object({ clipId: z.string().describe('The ID of the clip on the timeline to remove'), deleteMode: z.enum(['ripple', 'lift']).optional().describe('Whether to ripple delete (close gap) or lift (leave gap)') }) },
- src/tools/index.ts:464-465 (registration)Dispatch/execution routing in the executeTool switch statement, calling the handler with parsed args.case 'remove_from_timeline': return await this.removeFromTimeline(args.clipId, args.deleteMode);