Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions text file export script with strange end of line character

  • text file export script with strange end of line character

    Posted by Daniel Crooks on December 14, 2010 at 10:54 am

    hi people

    I’ve written a small script to export 3d positional data from a layer to a .txt file ( with a lot of inspiration from Paul Tuersley’s AEtoC4D script). I’m using writeln() and all is grand when viewed on a mac (textEdit and BBedit) but when the text file is opened on a PC (in notebook) it doesn’t understand the end of line character (presumably \n) and shows a small square with no return. After some research I tried using a “\r\n” on the end of the line as opposed to the writeln() but still no luck, also tried “\r” and “\n” individually but no luck. On the mac all 4 options perform the carriage return, but on the PC i get the same non character. I tried going backwards opening the pc created file on the mac and it looks exactly the same as my mac created version ???

    I did notice in Paul’s script he had this line – theFile.lineFeed = “macintosh”;
    I did try swapping in “windows” and “msdos” and commenting out entirely but no luck.

    any light that could be shed on this issue would be greatly appreciated.

    cheers../daniel

    Daniel Crooks replied 15 years, 5 months ago 2 Members · 7 Replies
  • 7 Replies
  • Dan Ebberts

    December 14, 2010 at 6:30 pm

    Try setting the linefeed to “Unix” (and leave out the \r\n stuff). I think both platforms can read that. Please report back. 🙂

    Dan

  • Daniel Crooks

    December 15, 2010 at 4:03 am

    hi Dan, thanks for the reply.

    I tried the “Unix” linefeed but no luck, (also tried lowercase “unix” ) but the non-character is still being inserted into one very long line of text. The one thing I did notice from a “correct” file created in Notepad is that it has a Unicode (UTF-8) encoding. I tried to save as one of text files in textedit with this encoding but it didn’t make any difference either…
    one last note, though I’m generating the file from AE on a Mac it only needs to be readable on a PC.

    cheers../daniel

  • Dan Ebberts

    December 15, 2010 at 4:23 am

    Try sticking this in there and see what happens:

    theFile.encoding = “CP1252”;

    Dan

  • Daniel Crooks

    December 15, 2010 at 4:52 am

    still no luck with “CP1252” …

  • Dan Ebberts

    December 15, 2010 at 6:39 am

    How big is your script? Can you post it?

    Dan

  • Daniel Crooks

    December 15, 2010 at 6:57 am

    hi Dan

    unfortunately I don’t have the script with me right now, but the external file writing code I borrowed from Paul’s AEtoC4D script which is here:
    https://www.btinternet.com/~paul.tuersley/scripts/pt_AEtoC4D_v1.4.zip
    that script is also what I have been using to test your suggestions so i figure it’s a safe bet to work with.

    cheers../daniel

  • Daniel Crooks

    December 17, 2010 at 10:41 am

    and finally… just in case anyone searches there way here in the future, the resolution to the problem was
    myfile.lineFeed = “windows”
    don’t know why it didn’t work first time round, maybe i forgot to save between edits, but anyway it works a treat.

    many props to Dan Ebberts and Paul Tuersley

    cheers../daniel

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy