Retaining formating of text when write new file with FILEIO

Hi all,
I wonder if there is any way to retain the formating of the
text when I write it in a new file using FILEIO. In particular I
have the following text in a field member:
test <background = L1_garaz/> (text in the tag has
color and itsbold) test
I use the following code to write the above text in a new
filw using FILEIO:
on mouseup
annot = member("annotator").text
path = the moviepath & "Annotated_text\"
whichanno = baGetFilename( "Save", ""&path&"", "",
"doc files|*.doc", 0, "Save doc file", 0, -2, 0 )
myanott = new(xtra "FileIO")
myanott.createfile(whichanno) --create
myanott.openFile(whichanno,0)
writeString(myanott,annot) --write the new string
myanott.closeFile()
myanott = VOID
end
the problme is that despite the type of file that i will
choose to save it (.doc, txt , etc) it refuses to save the text
with its initial formating (with the color, and bold words). Any
idea how to solve this?

"wgb14" <[email protected]> wrote in message
news:fc7nf2$av3$[email protected]..
> Hi all,
>
> I wonder if there is any way to retain the formating of
the text when I
> write
> it in a new file using FILEIO. In particular I have the
following text in
> a
> field member:
>
> test <background = L1_garaz/> (text in the tag has
color and itsbold)
> test
>
>
> I use the following code to write the above text in a
new filw using
> FILEIO:
>
> on mouseup
>
>
> annot = member("annotator").text
> path = the moviepath & "Annotated_text\"
> whichanno = baGetFilename( "Save", ""&path&"",
"", "doc files|*.doc", 0,
> "Save doc file", 0, -2, 0 )
>
> myanott = new(xtra "FileIO")
>
> myanott.createfile(whichanno) --create
> myanott.openFile(whichanno,0)
> writeString(myanott,annot) --write the new string
> myanott.closeFile()
> myanott = VOID
>
> end
>
> the problme is that despite the type of file that i will
choose to save it
> (.doc, txt , etc) it refuses to save the text with its
initial formating
> (with
> the color, and bold words). Any idea how to solve this?
>
What file format do you use to save the text?
Of course you need to use an appropriate file-format, or
invent your own.
Maybe try HTML or RTF.
Richard.

Similar Messages

  • Pages loses formatting and text when converting from docx or doc

    I receive .docx or .doc documents that I need to convert to a PDF. However, I frequently lose both formatting and text when I open the document in Pages. I don't understand how to fix the problem. I have tried copying/pasting the text into a new Pages document, but nothing changes.
    Also, I have heard there is a freeware program out there that some Apple users use that retains the formatting, but I don't know the name.
    Any ideas are greatly appreciated. I have to use a PC in the meantime.

    Hi Tricia,
    Like Yvan earlier, I must confess some surprise at Pages losing text content of a Word document on translation. Formatting, yet.
    The only circumstance where text loss seems at all likely is if the text was contained in a Text Frame. Even then, I would expect the frame to be converted to a Text Box, and the contents retained in the Pages document.
    Meantime, I would recommend you try OpenOffice.org or NeoOffice, either of which will open .doc and .docx files, and will save to either of those formats as well. The links will take you directly to the sites for these applications.
    Regarding the long download times: a 24 hour estimate would indicate you are on a dialup connection, or getting only dialup speeds. Most public libraries and a large number of coffee houses here in Canada offer free wireless hot spots that provide a high speed connection. If that's also true in Colorado, you might find it more efficient to take your MacBook to one of them for a shorter download time.
    Regards,
    Barry

  • Code doesn't update when uploading new files to website.

    code doesn't update when uploading new files to website.   I was using an old DW version for a long time then forced to upgrade when I bought my MacBook Pro. Now when I make changes to my pages and link to new files etc on my harddrive, when i upload the pages it won't image because the code still points to harddrive (this did not used to be a problem)... I manually changed the code on the web host site to point to the site and it loaded fine. But now my files on my harddrive also point to the web host files and now don't image on my computer. I never had to worry about this so far and wonder if the new version has a setting I'm supposed to be aware of so that I can design on my hardrive and upload and it knows that the files are being uploaded with it?  Ugh hpe this makes sense - I'm NOT a webs designer and the new DW is way more than I use in it's technology.

    Hi
    This sounds like you have not defined your site in the site definition.
    Follow the steps in these 2 tutorials to set-up your site locally and for the remote server -
    http://www.adobe.com/devnet/dreamweaver/articles/first_website_pt1.html
    http://www.adobe.com/devnet/dreamweaver/articles/first_website_pt6.html
    PZ

  • How to Raise alert in XI when a new file reaches application server

    Hey guys
    i have a requirement in which i need to trigger a piece of  ABAP code whenever a new file reaches a specific directory of Application server.
    i m using File adapter on receiver side and i want to raise a trigger so that the ABAP code is executed automatically whenever some new file reaches the directory
    we are running Win server
    thanx
    ahmad
    Message was edited by:
            Ahmad

    HI,
    It is possible to write a ABAP program to raise alert.and schedule it , In ABAP program we can check the file is existed or not in a specified folder if existes then we can raise Alert.Actually Alerts are maintained by SAP Alert Management only.
    So , but not clear , you said you are using the File receiver adapter .
    -- onoption is -this can bepossible with OS command .
    -- also we can raise alert from Payload itself , why becz i understand whenever you are going to write a file with file adapter then you need to raise an alert right?
    so if message is existed i mean data existed then from raise alert and store the file onoption
    -- Also you can try calling an ABAP program as the auto-reaction method of the MTE in CCMS
    Regards
    Chilla
    See the below links
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/434fa590-0201-0010-1e9a-c27e6283a0fe
    SMS through SAP ABAP program
    XI Alert from BPM with Follow-Up Activity
    ABAP programming BAPI To XML
    How to send qRFC Alert to Internet Email from AP0 3.1 running 4.6D BASIS
    /people/gregor.wolf3/blog/2005/03/05/create-users-in-an-abap-system-with-bapi-ostermiler-java-utilities

  • When I create a new file with 500px wide by 500px long it shows up on my screen as a rectangle.

    When I create a new file with 500px wide by 500px long it shows up on my screen as a rectangle. When I go to Image > Image Size it still shows the image as 500 x 500 yet it is clearly not a square. This also occurs if I try to create a circle, selecting the ellipse tool a checking the box for it to make a perfect circle it shows up as an oval.
    I have Photoshop CS6 on a macbook.
    Any help would be appreciated, I consider myself decently knowledgeable in Photoshop and I've looked through the settings, but I can't seem to figure out the issue, it's been happening for a while now, it's not a one-time fluke thing.
    Thank you.

    Is your pixel aspect ration set to square? Here 500 x 500 set to 2:1 aspect ratio pixels

  • How to create a new file with existing file's resource fork?

    Hello,
    I would like to create a new file that has the resource fork of an existing file. I had though of making a copy of the existing file, seek to the beginning of the copy and write the new data, but for large files, that creates the whole file even when not needed. I currently create the new file with [NSFileManager createFileAtPath: contents: attributes:], but attributes do not include resource fork items, like custom icons, color label, etc.
    [NSURL resourceValuesForKeys] gives a common subset of resource data, like icons and color label, but that's about it. Is there some way to get the resource fork or a copy of the file without getting the whole file?
    Thanks

    What are you trying to do here? While resource forks might still be quasi-supported, you really shouldn't be thinking about them as such. Instead, think in terms of extended attributes. You can use the low-level xattr() functions to get some of that or you can use the new NSURL methods.

  • Map with 500 pdfs. How to make a new file with only the first pages, new file with second pages etc.

    Hi,
    A client confronted me with the next question:
    I have a map with 500 pdf's in it.
    Is it possible to make a new file with only the first page of each pdf?
    After that to make a new file with only the second page of each pdf?
    And after that the third?
    Etc.
    Is that possible with an action?
    Or are there scripts for?
    I couldn't find them.
    I use an iMac with Acrobat XI.
    Any help is very welcome.
    Thanks in advance.
    Bornholm

    You can extract each page from each pdf as a seperate page.     Once this is done you can select the pages tocombine.
    You would have to write custom a custom JavaScript and programatically code the names to combine if the extracted file pages habvestandars naming that could  be programed. There maybe some security  coding you will have to do because of Adobe restrictions but this all documented in the Acrobat JavaScript Reference.

  • Action with new file with size from selection

    Hello,
    I try to record an action that takes a copy of the current image and creates a new file with the same dimensions. The action I record always has the file size of the new image hardcoded in it. I tried to set Preset to Clipboard, but this is not recorded in the action. This is with CS3.
    How can I create a new file that takes the current image size into account?
    Thanks for your help,
    Daniel

    You can record the menu 'Image-Duplicate' to make a copy of the whole image without recording the size. If the doc only has one layer you can also record the flyout menu of the layer's panel to duplicate the layer to a new document. The size will not be recorded.

  • Please a solution against crashes when opening a file with Acrobat XI pro?

    Hello,
    Am a member of Adobe Creative Cloud.
    Am also constantly having crashes when opening a file with Acrobat XI pro.
    Am running on Windows 7 Home Premium, Service Pack 1, 64 bit - RAM 20 GB -
    The crash happens systematically after the installation of the update. Within one day I uninstalled and reinstalled the program 4x! It takes of a lot of my time.... Thank you for providing a definitive solution!
    Best regards

    I've been having the same issue!  I try to open it and it crashes - says re-open, it crashes...  I re-installed it yesterday and it opened and worked fine.  Closed it out at the end of the day thinking everything was finally fine but this morning the same crashes it had yesterday...  HELP!!!

  • HT1386 I cannot find how to keep previous photo albums loaded on Ipad when syncing new ones with iTunes. The old ones are wiped out every single time

    I cannot find how to keep previous photo albums loaded on Ipad when syncing new ones with iTunes. The old ones are wiped out every single time

    If it's not too late, see Recovering your iTunes library from your iPod or iOS device. As long as you have a backup of the device when the device still held your photos you should stand a chance of recovering them using a tool such as iPhone Backup Extractor.
    tt2

  • Anyone know when the New Tour with the touch pad will ever come out for vzw?

    Anyone know when the New Tour with the touch pad will ever come out for vzw? Date,Day,Year, Month anything?

    My understanding is that the new Bold 9650 is considered the "new Tour" seeing as how the Tour is the Blackberry 9630.

  • How to format the text in an XML file

    This should be a fairly easy one. A fairly easy one that seems to be hard to actually find.
    When I write out the XML file, it's all on a single line. Not a huge problem all things considered (it works), but an annoying one.
    Here's the a snippet, to show what I'm doing. There's not enough information for this to actually compile, if one is so inclined, just comment out a bunch of things and have it write out aribitary data.
    Is this a case where I just need to manually write the formating myself?
    public void saveXML(File file){
            try{
                Document doc = DocumentBuilderFactory.newInstance().
                    newDocumentBuilder().newDocument();
                //give that document a root
                Element root = doc.createElement("root");
                doc.appendChild(root);
                Command[] command=getCommands();
                for (int index=0; index < command.length; index++){
                    Element element = doc.createElement("Command");
                    root.appendChild(element);
                    //get the name of the parser class this command should use
                    String pName=command[index].getParser().getClass().getName();
                    //remove everything but the last word
                    pName=pName.substring(JavaMUServer.PARSER_PATH.length());
                    //set the information.
                    element.setAttribute("name",
                        command[index].getName());               
                    element.setAttribute("parser",pName);               
                    element.setAttribute("method",
                        command[index].getMethod().getName());
                TransformerFactory tFactory =TransformerFactory.newInstance();
                Transformer transformer = tFactory.newTransformer();
                DOMSource source = new DOMSource(doc);
                StreamResult result = new StreamResult(
                    new FileWriter(file));
                transformer.transform(source, result);
            }catch (Exception e){
                e.printStackTrace();
        }

    Well, that helped quite a bit. Seems however when I set the indent property, rather then indenting it just makes new lines. Rather counter intuitive.
    Here's the slightly modified code (changed one line really. Tried setting a few different properties.)
    public void saveXML(File file){
            try{
                Document doc = DocumentBuilderFactory.newInstance().
                    newDocumentBuilder().newDocument();
                //give that document a root
                Element root = doc.createElement("root");
                doc.appendChild(root);
                Command[] command=getCommands();
                for (int index=0; index < command.length; index++){
                    Element element = doc.createElement("Command");
                    root.appendChild(element);
                    element.appendChild(doc.createElement("sample"));
                    //get the name of the parser class this command should use
                    String pName=command[index].getParser().getClass().getName();
                    //remove everything but the last word
                    pName=pName.substring(JavaMUServer.PARSER_PATH.length());
                    //set the information.
                    element.setAttribute("name",
                        command[index].getName());               
                    element.setAttribute("parser",pName);               
                    element.setAttribute("method",
                        command[index].getMethod().getName());
                TransformerFactory tFactory =TransformerFactory.newInstance();
                Transformer transformer = tFactory.newTransformer();
                transformer.setOutputProperty("indent", "yes");
                //transformer.setOutputProperty("method", "xml");
                DOMSource source = new DOMSource(doc);
                StreamResult result = new StreamResult(
                    new FileWriter(file));
                transformer.transform(source, result);
            }catch (Exception e){
                e.printStackTrace();

  • File Name not set when creating new file in EP 6.0 SPS20

    Hi,
    We recently upgraded from EP6 SP15 to SP20. Now when I create a new file or folder in a KM folder, the name that I give for the resource is not taken into account. The display name  of the newly created resource will be <b>New Text</b> or <b>New HTML Document</b> or <b>New Folder</b>, etc. Even if I open the Properties and change it there, it is not getting reflected. But if I select Rename from the Context menu and give a new name, it gets set. What could be the problem?
    Thanks in advance
    Regards
    Ranjith

    Hi,
    It was an issue with the customized PropertiesControl class.
    Regards
    Ranjith

  • What is the best format to choose when converting mts files to fit well with iMovie? I am using iCoolsoft for conversions and can pick from almost any kind of formats to convert to. I don't want to get the black frames... what do you advice me to pick?

    I have lots of MTS files stored on an external hard drive that I want to use in my iMovie films. Now, as you know, iMovie doesn't like them. I have bought iCoolsoft for converting my video files into any format I want but now I've got another problem: what format is the best for iMove? Some of the formats I've tried are giving me a black frame around the video clips and some are bigger and other smaller but anyway I don't want them at all! Can anyone recommend what format to convert to to keep the original clip's size and no frames and still be liked by iMovie to be able to import them?
    Much thankful for any kind of support and reply on this one.
    Eva

    The format iMovie uses when you edit video after it's imported is Apple Intermediate Codec, it will have the file ending .mov but internally it's set so the Mac can edit individual frames easier and play them back easier at full speed. If you have the option of saving to QuickTime .mov see if there is a pulldown list of all the different "codecs", that's the style or flavor of compression applied to the video frames. If Apple Intermediate Codec (AIC) appears on that pull-down list choose that as your codec when you save to .mov.

  • Photoshop Elements V12.1 crashes when trying to save file. Mac OS 10.6.8 on MacBookPro. App has worked before. Cannot even save a new file with a simple change.

    How to bring Photoshop Elements V12.1 back to working condition. Tried shutting down MacBookPro. Starting up. Launch Elements. Open a new file. Add text. Save file. App crashes. This is repeatable with different attempts. The app is useless at this point. Any ideas?

    Well, FWIW, PSE 12 isn't supposed to be compatible with 10.6, although the editor does work for most people.
    Go to the editor's preferences>general, click this button and restart the editor:

Maybe you are looking for