# Why do empty spaces cause syntax error?

**URL:** <https://forums.steinberg.net/t/why-do-empty-spaces-cause-syntax-error/677856>\
**Category:** Virtual instruments\
**Created:** [July 3, 2017, 3:07pm UTC](https://forums.steinberg.net/t/why-do-empty-spaces-cause-syntax-error/677856 "2017-07-03T15:07:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![misohoza](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@misohoza](https://forums.steinberg.net/u/misohoza)\
**Post date:** [July 3, 2017, 3:07pm UTC](https://forums.steinberg.net/t/why-do-empty-spaces-cause-syntax-error/677856/1 "2017-07-03T15:07:40Z")

</div>

Whenever I try to copy and paste a script from the forum or from the Steinberg’s developer site, the script module gives me a syntax error. This script is copied from the developer site:

```nohighlight
-- find all effects and print their names
effects = this.program:findEffects(true)
 
if effects[1] then
    for i, effect in ipairs(effects) do
        print(effect.name)
    end
else
    print("Could not find any effects!")
end

```

The script is perfectly ok when typed in manually.

But when I copy and paste it I get this: \_Syntax Error: 3: unexpected symbol near char(194):  
\_  
After deleting the empty line 3 the first error is fixed but then I get this:  
_Syntax Error: 4: unexpected symbol near char(194): for i, effect in ipairs(effects) do_

Does anyone know why is this happening and how to fix this?

---

<div class="post-metadata">

**Author:** ![AposMus](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@AposMus](https://forums.steinberg.net/u/AposMus)\
**Post date:** [July 4, 2017, 1:25pm UTC](https://forums.steinberg.net/t/why-do-empty-spaces-cause-syntax-error/677856/2 "2017-07-04T13:25:15Z")

</div>

I’ve had the same issue.

I suspect when you copy scripts from the developer site you use double click to select all, as their tool tip suggests.

For some reason this ads a few blank or “space” ascii characters to the copied script. I’ve found if you select all text by the normal click and drag way (bottom to top is easiest), you avoid this issue.

---

<div class="post-metadata">

**Author:** ![misohoza](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@misohoza](https://forums.steinberg.net/u/misohoza)\
**Post date:** [July 5, 2017, 1:45pm UTC](https://forums.steinberg.net/t/why-do-empty-spaces-cause-syntax-error/677856/3 "2017-07-05T13:45:53Z")

</div>

Thanks AposMus.

At least I know I’m not the only one having this issue.  
Unfortunately doing it the way you suggested doesn’t work for me either. I can copy it line by line which is not really efficient.

Thanks for confirming.

---

<div class="post-metadata">

**Author:** ![Chris.StAubyn](https://dub1.discourse-cdn.com/steinberg/user_avatar/forums.steinberg.net/chris.staubyn/32/176917_2.png) [@Chris.StAubyn](https://forums.steinberg.net/u/Chris.StAubyn)\
**Post date:** [August 1, 2017, 2:25am UTC](https://forums.steinberg.net/t/why-do-empty-spaces-cause-syntax-error/677856/4 "2017-08-01T02:25:55Z")

</div>

You guys are a life saver! I was ready to throw my computer in frustration lol.

---

<div class="post-metadata">

**Author:** ![Tekknovator](https://dub1.discourse-cdn.com/steinberg/user_avatar/forums.steinberg.net/tekknovator/32/1941_2.png) [@Tekknovator](https://forums.steinberg.net/u/Tekknovator)\
**Post date:** [August 11, 2017, 4:04pm UTC](https://forums.steinberg.net/t/why-do-empty-spaces-cause-syntax-error/677856/5 "2017-08-11T16:04:54Z")

</div>

I always use an external editor such as Atom or VSCode with lua extensions. They show pretty quickly if there is something fishy about your code and you can clean up whitespace stuff. The only annoying thing is that you need to save your script in a lua file before the external editor can open it.  
You can configure the external editor in options. Now when you click the edit button it will open the external editor instead of the annoying built in. I guess the build in is really just for glimpsing at a script or making a quick change.

---

<div class="post-metadata">

**Author:** ![Ed\_Doll](https://dub1.discourse-cdn.com/steinberg/user_avatar/forums.steinberg.net/ed_doll/32/138966_2.png) [@Ed\_Doll](https://forums.steinberg.net/u/Ed_Doll)\
**Post date:** [August 14, 2026, 9:20am UTC](https://forums.steinberg.net/t/why-do-empty-spaces-cause-syntax-error/677856/6 "2026-08-14T09:20:09Z")

</div>

Unlisted on August 14, 2026, 9:20am UTC


