set_item_length
Adjust a media item's length in REAPER by specifying seconds or musical measures, with items identified by track index and either position or direct ID.
Instructions
Set the length of a media item.
Item Identification - Accepts BOTH types:
track_pos_idx (integer): Simple index like 0, 1, 2
direct_item_id (string): Internal ID like "MediaItem*0x..."
Args: track_index: Index of the track item_id: EITHER integer track_pos_idx OR string direct_item_id length_time: Length in seconds from start of item (optional if length_measure is provided) length_measure: Length as "measure:beat,fraction" from start of item(optional if length_time is provided)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"track_index": "<track_index>",
"item_id": "<item_id>"
},
"name": "set_item_length"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item_id | Yes | ||
| length_time | No | ||
| track_index | Yes | ||
| length_measure | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |