Var orderNumberLocation = str.search("Order Number: ") + 14 Var b = new File("~/Desktop/Test/email.txt") I have tried things like \n and \r\n and ^p both with and without quotes around them but none of those seem to show up in the array when I try them. What is the character I need to use to emulate a return key in a txt file in javascript for extendscript for indesign? It's a bit convoluted, but I'm not great with Javascript yet, and if there is an easier way, I don't know it. I will then use whichever array object is a higher number than the first number for the substring. To do this, I have another piece of script from the helpful people of this site that makes an array out of the indexes of every instance of a character. I want to use where the return key was hit to go to the next line as the second index number to finish the substring. I have a script made from parts I found on this site that finds the end of "Order Number:" in order to get a starting position of a substring. I am using extendscript to build some invoices from downloaded plaintext emails (.txt)Īt points in the file there are lines of text that look like "Order Number: 123456" and then the line ends.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |