<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=windows-1252">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hm, it seems more difficult than that:<br>
    <div class="moz-forward-container">If I use  local outfile =
      io.open("c:\\test.txt", "w<b>b</b>") (=binary file) 
      instead, the EOL output is fine: 0d 0a.<br>
      If I use  local outfile = io.open("c:\\test.txt", "w"), the EOL
      output is: 0d 0d 0a.<br>
      If I remove text:AppendEOL(), the end of the file is empty (no 0d
      at all !) no matter whether I use "wb" or "w".<br>
      So maybe that's the typical Lua behaviour and I should use a
      binary file with "wb" although the result will be a text file.<br>
      <br>
      Jan<br>
      <br>
      -------- Weitergeleitete Nachricht --------
      <table class="moz-email-headers-table" border="0" cellpadding="0"
        cellspacing="0">
        <tbody>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Betreff:
            </th>
            <td>[JW Lua] FCString:AppendEOL appends 0d 0d 0a on Windows</td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Datum: </th>
            <td>Wed, 22 Jul 2015 19:00:03 +0200</td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Von: </th>
            <td>Jan Angermüller <a class="moz-txt-link-rfc2396E" href="mailto:jan@angermueller.com"><jan@angermueller.com></a></td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Antwort
              an: </th>
            <td>The JW Lua script plug-in. <a class="moz-txt-link-rfc2396E" href="mailto:jwlua@jwmusic.nu"><jwlua@jwmusic.nu></a></td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">An: </th>
            <td>The JW Lua script plug-in. <a class="moz-txt-link-rfc2396E" href="mailto:jwlua@jwmusic.nu"><jwlua@jwmusic.nu></a></td>
          </tr>
        </tbody>
      </table>
      <br>
      <br>
      <pre>Jari,

FCString:AppendEOL() appends a "0d 0d 0a" instead of the typical "0d 0a" 
on Windows.
Code snippet below.

All the best,
Jan


local text=finale.FCString()
text.LuaString="Test"
text:AppendEOL()
local outfile = io.open("c:\\test.txt", "w")
outfile:write(text.LuaString)
outfile:close()

The created file then has the following hex codes:
54 65 73 74 0D 0D 0A

(54 65 73 74 =="Test")

_______________________________________________
JWLua mailing list
<a class="moz-txt-link-abbreviated" href="mailto:JWLua@jwmusic.nu">JWLua@jwmusic.nu</a>
<a class="moz-txt-link-freetext" href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a>

</pre>
      <br>
    </div>
    <br>
  </body>
</html>