List/array field as input to script

I’m creating a script that I would like to take a list of strings, in a similar what that media_player.join does for the ‘group_members’ field. How do you do that? I cannot seem to find a selector type that would do that.

Thank you

Not sure what you want, can you please provide a “this is what I have” and “this is what I want” use-case?

So let’s say your script looks as follow:

play_file:
  alias: "Play Media"
  description: "Play specified media."
  fields:
    media_content_id:
      name: "Content ID"
      description: "The ID of the content to play. Platform dependent."
      required: true
      selector:
        text:

  sequence:
    # do something here

  mode: queued
  icon: mdi:music-box

What if I wanted the media_content_id to not be a single string, but instead a list / array of media content ids? I also want it to show up in the automation editing UI as a list, similar to the Group Members parameter in media_player.join service call. See here:

I cannot try this out myself right now as for some odd reason, nothing is cast to any of my media players and since I hardly use this, not sure when that started.
So…although I cannot test it at all, it could be something like this, using a folder called musiclist that you added as a folder-sensor
The folder you can manage and create scripts to add/remove stuff

media_content_id: "/media{{ state_attr('sensor.musiclist', 'file_list') }}"

Thanks for the suggestion. I was going to consider that route, or something similar, if I couldn’t figure out how to get an array or list sent to the script. It has to possible in some capacity since media_player.join does it. I’ll see if I can find some reference in the source code in HA.

Huh, they are using the Object selector. I’ll that a whirl.