move_clip
Reposition video clips on the timeline by specifying new time positions and track indexes in Adobe Premiere Pro.
Instructions
Moves a clip to a different position on the timeline.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clipId | Yes | The ID of the clip to move | |
| newTime | Yes | The new time position in seconds | |
| newTrackIndex | No | The new track index (if moving to different track) |
Implementation Reference
- src/tools/index.ts:1065-1109 (handler)The main handler function for the 'move_clip' tool. It constructs and executes an ExtendScript via the PremiereProBridge to move the specified clip to a new time position on the timeline, optionally changing its track.private async moveClip(clipId: string, newTime: number, newTrackIndex?: number): Promise<any> { const script = ` try { var clip = app.project.getClipByID("${clipId}"); if (!clip) { JSON.stringify({ success: false, error: "Clip not found" }); return; } var oldTime = clip.start.seconds; var oldTrack = clip.getTrack(); var oldTrackIndex = oldTrack.index; clip.start = new Time("${newTime}s"); ${newTrackIndex !== undefined ? ` var newTrack = app.project.activeSequence.videoTracks[${newTrackIndex}]; if (newTrack) { oldTrack.removeClip(clip, false); newTrack.insertClip(clip, new Time("${newTime}s")); } ` : ''} JSON.stringify({ success: true, message: "Clip moved successfully", clipId: "${clipId}", oldTime: oldTime, newTime: ${newTime}, oldTrackIndex: oldTrackIndex, newTrackIndex: ${newTrackIndex !== undefined ? newTrackIndex : 'unchanged'} }); } catch (e) { JSON.stringify({ success: false, error: e.toString() }); } `; return await this.bridge.executeScript(script); }
- src/tools/index.ts:163-170 (schema)The input schema and metadata for the 'move_clip' tool, defining parameters and descriptions used for validation and tool discovery.name: 'move_clip', description: 'Moves a clip to a different position on the timeline.', inputSchema: z.object({ clipId: z.string().describe('The ID of the clip to move'), newTime: z.number().describe('The new time position in seconds'), newTrackIndex: z.number().optional().describe('The new track index (if moving to different track)') }) },
- src/tools/index.ts:466-467 (registration)The dispatch registration in the executeTool switch statement that maps the tool name 'move_clip' to its handler method.case 'move_clip': return await this.moveClip(args.clipId, args.newTime, args.newTrackIndex);