(JS) How to set list value from file? #427
-
How to set list value from file in project folder? |
Beta Was this translation helpful? Give feedback.
Answered by
GarboMuffin
Jun 13, 2022
Replies: 1 comment
-
most easily you just use right click -> import/export on a list watcher. If that doesn't work for you:
fetch("file.txt")
.then(r => r.text())
.then(text => {
vm.runtime.getTargetForStage().lookupVariableByNameAndType("list name", "list").value = text.split("\n");
})
You can get the list data from |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
piw-piw
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
most easily you just use right click -> import/export on a list watcher. If that doesn't work for you:
You can get the list data from
vm.runtime.getTargetForStage().lookupVariableByNameAndType("list name", "list").value
and convert that to a string to download to your computer.