Carpet

Carpet

2M Downloads

[Scarpet suggestion] get_app_name()

altrisi opened this issue ยท 3 comments

commented

I think a get_app_name() could be really useful in Scarpet to, well, get the name of the app which is running it.
There are multiple uses I can think for that right now:

  • Making a clickable command in chat for the current app without relying on the user not having modified the file name, since right now command names are based on app name
  • Workaround to implementing app-to-app communication (by running something like run('script in [other_app] run __register_listener('+get_app_name()+'),...') so the other app knows the name of the first app once again without relying on the user not having renamed the script. Here [other_app], since it would be like an API, could have published its name in a system variable by running the same function. For an example of a partial definitive solution for this part, see #244)

A list of loaded apps (EDIT: Just found loaded_apps() undocumented in the code @ Apps.java) or a way to see if a specific app is loaded would also be nice (maybe even with some app-specific metadata), but that is (way) out of the scope of this issue.

commented

sounds useful

commented

actually it seems gnembon has done that in App.java, but he's clearly working on it still.

commented