This content has been marked as final. Show 3 replies
If your original text file is formatted then you can just import the
whole file and keep the formatting.
Create a new text member. Name it.
member("new text member").fileName = "original file.rtf"
If the original file was saved in rtf format, all of the original
formatting will be imported along with the text itself.
Adobe Community Expert
Unfortunately, its just a raw text file.
infact saved text is in a list format. eg.
"headline 1 here" , "content for 1st item here" , "headline 2 here",
"content number 2 here", etc....
I'm importing as a list, and then creating 2 other lists from this - ie.
odd numbered items are headlines, even ones are content.
I think i could probably write some code to change the 1st line of the text
to be bold (member("news").line = #bold), then check how many lines were
added and do this again with member("news").line[totalLines+1] = #bold
Just wondering if there was a simple way; like there is in html/php..
Thanks for the reply though!
"Rob Dillon - Adobe Community Expert" <rob@-remove-ddg-designs.com> wrote in
> If your original text file is formatted then you can just import the
> whole file and keep the formatting.
> Create a new text member. Name it.
> member("new text member").fileName = "original file.rtf"
> If the original file was saved in rtf format, all of the original
> formatting will be imported along with the text itself.
> Rob Dillon
> Adobe Community Expert
You can use (very basic) HTML to format the text. For example, you could do something like this
str = "<b>This is a heading</b><p>This is some text</p>"
Otherise. just set the fontstyle of each line (like you were going to). Unfortunately, there is no "inside quotes $variables' like in PHP (which certainly makes formatting text much easier)
(ShowHTML function below - I hope - never quite worked out how this forum is meant to work...)