How to get a name of object? (sprite, costume, sound)

How do we get a name of objects?

Advanced Codification 9 script pic

It would look like this

untitled script pic 32
untitled script pic 33
untitled script pic 34

  1. It does not give name of costume object, it gives name of current costume of sprite object.
  2. It does not give name of any sprite object, you would need to ask other sprites to get them.
  3. This one is correct, it gives name of sound object.

untitled script pic 35
If a costume object is not in the costume list it doesn’t have a name (I don’t think)
There’s also this
untitled script pic 36
This works different

untitled script pic 36

This works different?

(Costume name) of (my costume) doesn’t work, but that does

Um, it does work for me?
Advanced Codification 9 script pic (1)

That’s what imnsaying

I think @cookieclickerer33 meant the following:
Imagine that you have a sprite with a costume named "Smiley".
Screenshot 2023-05-12 8.15.18 AM
The following script, ((costume name) of (my (costume))), does not work, as it returns
untitled script pic - 2023-05-12T081457.799
However, this script, ((name) of costume (my (costume))), does work, returning
untitled script pic - 2023-05-12T081645.462

Here's how to get the name of a sprite

the bad way

Is there any other way? The reason why I posted that, was because the title mentions getting the name of a sprite, yet no one here has given a solution to that.

I asked about getting a name of object, not about getting a name of sprite object. I also wanted to learn if there is any other way to do that

What do you mean, an object? Like {foo: "bar"}??

Im not sure if i understand what foo bar is, by object i mean 3 types, sprites, costumes, sounds, the input would take object, and give a name of object we placed in input

Name of Sprite:
untitled script pic - 2023-05-12T085421.280
Name of costume:
untitled script pic - 2023-05-12T085440.728
Name of sound:
untitled script pic - 2023-05-12T085506.195

You can trivially write that using the IS _ A _ ? block to find out which kind of object your input is.

I can, in fact i do, i just thought there might be some other way

Well, you could do something like this

There is a deep idea behind the syntactic differences. Costumes and sounds are passive objects: they can't run blocks. Only sprites and the stage are active objects, a/k/a actors, a/k/a agents. (Yeah, the stage breaks the actor metaphor.) So, in particular, only actors can run the MY block, as in MY NAME. To find the name of a passive object, you have to get an active object to run a block along the lines of _ OF COSTUME _.