EOS eval script output to screen
-
- Explorer
- Posts: 26
- Joined: Sun Jun 24, 2018 3:16 pm
EOS eval script output to screen
I'm sure there is an easy answer to this, but my searching has come up with nothing. I'm trying to find out how to have a snippet of javascript I have executing inside an eval action output something to the screen (like it would in a Say action). For example, in a piece of If-Else code, I want one of the results to display a text string to the screen - but I can't figure out the command. I've managed to find answers to all my other questions floating around, just not this one. Thanks.
Re: EOS eval script output to screen
Best you can do in standard EOS is something like this in an EVAL:
Then add a Say action after that eval, click that say action's "<>" button, then in the "Insert Eval Tag" dialog, enter: myVariable
Or, if you have a notification displayed, you can update the text in the notification:
But you can't dynamically generate an action in EOS.
This limitation in EOS is one of the reasons I created OpenEOS.
Code: Select all
var myVariable = 'Hello World.'
Or, if you have a notification displayed, you can update the text in the notification:
Code: Select all
Notification.get('my-notification-id').setTitle('Hello world.')
This limitation in EOS is one of the reasons I created OpenEOS.
-
- Explorer
- Posts: 26
- Joined: Sun Jun 24, 2018 3:16 pm
Re: EOS eval script output to screen
So even though I can create an action like pages.goto, there's no equivalent for displaying to screen? I guess I can make your recommendation work, but it'll be kind of a pain. Thanks for the response.
Re: EOS eval script output to screen
You can also use expressions in the say action's eval like phönix pointed out. If they need to be more complex, you can define a function that returns the value to be displayed, then call that in the say's eval.emiumfinal wrote: ↑Fri Jan 01, 2021 6:24 am So even though I can create an action like pages.goto, there's no equivalent for displaying to screen? I guess I can make your recommendation work, but it'll be kind of a pain. Thanks for the response.
Else, if you chose to use OpenEOS use can do something like:
Code: Select all
if (i) {
new Say({
label: "I is truthy"
})
} else {
new Say({
label: "I is falsey"
})
}
Who is online
Users browsing this forum: No registered users and 7 guests