move_clip
Easily reposition a clip on the Adobe Premiere Pro timeline by specifying its new time and track index using this tool. Automate clip movement for precise video editing workflows.
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 core handler function for the 'move_clip' tool. It constructs an ExtendScript for Premiere Pro to locate the clip by ID, adjust its start time to the new position, and optionally move it to a new video track by removing and re-inserting it.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:165-169 (schema)Zod schema defining the input parameters for the move_clip tool: clipId (required string), newTime (required number), newTrackIndex (optional number).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:163-170 (registration)Registration of the move_clip tool in the getAvailableTools() array, including name, description, and schema.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:467-468 (registration)Dispatch/registration in the executeTool switch statement that routes calls to the moveClip handler.return await this.moveClip(args.clipId, args.newTime, args.newTrackIndex); case 'trim_clip':