top of page

3

Media

AZSTOKe_sample_CountSelectedMediaItems

Output the number of selected media

RANK

function Msg(param)

   reaper.ShowConsoleMsg(tostring(param).."\n")

end


retval,allCount,_ = reaper.AZ_GetSelectedMediaTypeCount(0,"")


for i = 0,allCount-1 do

   retval,name = reaper.AZ_GetSelectedMediaName(0,i)

   name = name.."_ng"

   reaper.AZ_SetSelectedMediaName(0,i,name)

   Msg(name)

end

function Msg(param)

reaper.ShowConsoleMsg(tostring(param).."\n")

end

  • Msg Set the console output function


retval,allCount,_ = reaper.AZ_GetSelectedMediaTypeCount(0,"")

  • Get the number of selected media (allCount)



for i = 0,allCount-1 do

  • Loop from 0 to the variable (allCount-1)

retval,name = reaper.AZ_GetSelectedMediaName(0,i)

  • Save the selected media name in variable (i) in variable (name).

name = name.."_ng"

  • Add _ng to the variable (name)

reaper.AZ_SetSelectedMediaName(0,i,name)

  • Set the variable (name) to the media name of the selected media ID (i)

Msg(name)

  • Prints the media ID to the console

  • Run allCount times


end

To use the API, you need to sign up for a plan.

Download the dedicated API

need to do it.

*SILVER is scheduled to be released in May.

  1. Multiple media in a project

- Script Code -
- Script Image -
- Warm Up -
- Script Detail -
- API -

LUA

​ReaScript File Download 👇

* A dedicated API is required to run this

- Script Image -
bottom of page