You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[enhancement]: add "object script path" to a block #1798
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.
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
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.
Example: The object id of a script is script.js.Web.Instagram-Followers. You can use the following Block to get this ID:
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.
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.
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.
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.
Activity
klein0r commentedon Jan 13, 2025
But
javascript.0.scriptEnabled.example-scriptis not the ID of the script. I don't get the use case of this request.Name of scriptalready provides the object iddarkiop commentedon Jan 13, 2025
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.
klein0r commentedon Jan 14, 2025
Example: The object id of a script is
script.js.Web.Instagram-Followers. You can use the following Block to get this ID: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.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.
klein0r commentedon Jan 14, 2025
You could use
message to other scriptwhen the script starts (which has a trigger). In that case you don't need to know the object id of the other script.darkiop commentedon Jan 14, 2025
Thanks for you help Matthias.
With

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.
klein0r commentedon Jan 15, 2025
But in which case is a trigger (on the enabled state) useful for the current script?
darkiop commentedon Jan 15, 2025
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.