OK, now I see the problem.
You started a <span>
, then started a <<timed>>
macro, and then you tried to end that <span>
within that <<timed>>
macro.
If you start X, and then start Y, you then must end Y before you can end X. They can’t cross over each other like that.
Also, you started <span>
s e2 through e8, plus the very first <span>
, but never closed any of them.
This is why indenting your code whenever you start a group, and unindenting when you end that group, is highly recommended when writing code. It makes it much harder to make that mistake.
Also, your <<button>>
is missing the “>>” part, you have unnecessary <<script>>
and <<print>>
macros, and the <<print>>
macro doesn’t have a closing <</print>>
tag.
Here’s my best guess at the corrected code, with indentation:
<span style='font-family: courier'>
<span id="e1">\
Some words
</span>\
<<timed 4s>>\
<span id="e2">\
Some words.
</span>\
<<remove "#e1">>\
<<next 3s>>\
<span id="e3">\
Fast Forwarding.
</span>\
<<next 1s>>\
<<remove "#e2">>\
.Some words..
<<next 2s>>\
<<remove "#e3">>\
<span id="e4">\
Fast Forwarding.
</span>\
<<next 4s>>\
<<remove "#e4">>\
<span id="e5">\
Some words 1
</span>\
<<next 2s>>\
<<remove "#e5">>\
<span id="e6">\
Some words 2
</span>\
<<next 2s>>\
<<remove "#e6">>\
<span id="e7">\
Some words 3
</span>\
<<next 2s>>\
<<remove "#e7">>\
<span id="e8">\
Some words.
</span>\
<<next 3s>>\
<<button "Continue">>
<<append "#e9">>\
Some words
<</append>>
<<timed 1s>>
<<append "#e9">>\
Some words
<</append>>
<<next 1s>>
<<append "#e9">>\
Some words
<</append>>
<<next 1s>>
<<append "#e9">>\
Some words.
<</append>>
<</timed>>
<</button>>
<</timed>>\
<span id="e9">\
</span>
</span>
I added a few minor changes (such as the numbers after “Some words”) so that you could see that the text changed. Also, I had to guess a little bit about what you were trying to do with the <<button>>
code. Hopefully I got all of that more-or-less correct.
The "\
"s that you see at the end of lines are to prevent line breaks at that point. They make it easier to do indentation in your code.
Speaking of indentation, you should see there how, each time you start another group, you indent, and then unindent when the group is closed. Each set of consecutive lines of code at the same indentation level or higher, helps group that code within the parent set. So, for example, all of the lines indented one further level in after a <<next 2s>>
line would be executed after that two second wait finishes, up to where the code unindents, which represents the end of that group of code.
Please let me know if you need any help understanding what any of that does or how it’s working if you can’t figure it out yourself by playing around with the code and reading the relevant parts of the SugarCube documentation.
Have fun!