Skip to content

[enhancement]: add "object script path" to a block #1798

Open

Description

@darkiop

Describe the solution you'd like
image

add the path of the current script to this block (first below "System"), like

javascript.0.scriptEnabled.example-script

Why? If the script (start, restart) itself is used as a trigger, you are more flexible with an automatically determined script path in case the script is renamed.

Activity

  1. klein0r commented on Jan 13, 2025

    @klein0r
    Collaborator

    But javascript.0.scriptEnabled.example-script is not the ID of the script. I don't get the use case of this request.
    Name of script already provides the object id

  2. darkiop commented on Jan 13, 2025

    @darkiop
    Author

    Hi Matthias, for something like this, for example - a block that generates javascript.0.scriptEnabled.PRODUKTIV.VIS.Statustexte.01_Muell, the script name in the script itself would be dynamic (if renamed). I have a few scripts like this that should trigger initially when the script is restarted.

    image
    image

  3. klein0r commented on Jan 14, 2025

    @klein0r
    Collaborator

    Example: The object id of a script is script.js.Web.Instagram-Followers. You can use the following Block to get this ID:

    Screenshot 2025-01-14 at 10 40 56

    If you want to know the current state of the script (running), you need to use this state: javascript.0.scriptEnabled.Web.Instagram-Followers. Just replace the parts in the string.

    Screenshot 2025-01-14 at 10 43 39

    the script name in the script itself would be dynamic

    The name is not the problem. The object ID is the problem. And there is no option to "rename" an object. It's always delete + create new. So there is technically no solution for your problem.

  4. klein0r commented on Jan 14, 2025

    @klein0r
    Collaborator

    You could use message to other script when the script starts (which has a trigger). In that case you don't need to know the object id of the other script.

  5. darkiop commented on Jan 14, 2025

    @darkiop
    Author

    Thanks for you help Matthias.

    With
    Image
    i get what i need. But I should have come up with the solution myself ;)

    I just thought that thematically this output would fit well into the mentioned block.

  6. klein0r commented on Jan 15, 2025

    @klein0r
    Collaborator

    But in which case is a trigger (on the enabled state) useful for the current script?

  7. darkiop commented on Jan 15, 2025

    @darkiop
    Author

    The script above generates a text from various DPs from different sources. On the one hand, the trigger directly on the script makes it easier to work on the script (make adjustments, restart script, texts are generated) and on the other hand, it also ensures that the texts are up-to-date when the JS instance or the entire system is restarted. This has worked quite well so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions