How do I get the URL of a GUI script? (SOLVED)

I want to get the absolute url (or a hash to it) of the current gui script, so I can store it in some module code other scripts might access to send mesages to this gui script. In component scripts I would do go.get_id("#"). Is there a similar method for gui scripts?

I can work around this by sending a message to an external component which gets the value I need as the sender argument, but it’s a bit contrived.

Furthermore, is there a way of knowing if you’re in a GUI, component or render script at runtime (as module code)?

mgs.url() without any args will create a URL set to the running script:

local url_of_script = msg.url()
1 Like

Thanks. Couldn’t find the API docs for msg. Sorry for bugging you.

No worries, the documentation for msg is here.