Creating a TextEdit rtf file

Here is what I want to do with Automator:
Create a new textEdit rtf document
Be prompted to name the file
Once I name the file I want the file to open in Textedit ready for me to work on
The document I create as to have two different formats. For example, the first line bold italic, and the rest of the document, plain text.
Is this possible using Automator?

Hi there Randy,
try this...
1) New Text Edit Document
2) Run AppleScript
Replace the code with this...
click here to open this script in your editor<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:400px">on run {input, parameters}
activate application "TextEdit"
tell application "System Events"
tell process "TextEdit"
keystroke "b" using command down
keystroke "Bold Headline"
keystroke "b" using command down
keystroke return
keystroke "s" using {command down, shift down}
end tell
end tell
return input
end run</pre>
You will need to turn on GUI Scripting for this to work...
regards
Ric

Similar Messages

  • Security update 2007-007 gives TextEdit & RTF file error ?

    I am having trouble editing RTF files using TextEdit and I think the Security Update 2007-007 is the culprit, but have no idea how to fix this.
    I have repaired permission via disk utility, but this did not fix the problem.
    When I use TextEdit to edit existing RTF files, the file is brought up into the window, but the contents are in its raw format. The TextEdit window has:
    {\rtf1\mac\ansicpg10000\cocoartf102
    {\fonttbl\f0\fswiss\fcharset77 Arial-BoldMT;\f1\froman\fcharset77 Times-Bold;\f2\froman\fcharset77 Times-Italic;
    \f3\froman\fcharset77 Times-Roman;\f4\froman\fcharset77 TimesNewRomanPSMT;}
    {\colortbl;\red255\green255\blue255;}
    and so on for the file.
    If I edit this same file with Safari, the xxx.rtf file comes up nicely formatted.
    I am able to see that the Security Update 2007-007 was installed on
    2007-08-14 23:02:04 -0500: Installed "QuickTime" (7.2)
    2007-08-14 23:04:28 -0500: Installed "Security Update 2007-007" (1.0)
    As per the software update log file.
    Also, I see that the TextEdit application file was changed at around same time:
    ls -l /Applications/TextEdit.app/Contents:
    drwxrwxr-x 4 root admin 136 17 Aug 07:41 MacOS
    everything else in the directory has a 2003 date on it.
    Inside MacOS directory is the TextEdit binary, which also has the same new modification date.
    I grabbed a TextEdit binary from another machine (a G3 running 10.3.9) that has not had the security update on it and replaced my TextEdit, and after rebooting just to make sure it was not running an in memory copy, the problem still persists.
    The sum for the broken TextEdit is: 30845 128 TextEdit.broken
    Also, if I create a new file with TextEdit and edit it (bold, underline, etc) and save as an RTF file and then close the file. When I re-open the file, the file comes up as raw garbage.
    So, TextEdit is dead. Any ideas how to revive it?
    thanks

    pdmazz:
    Welcome, again, to Apple Discussions.
    I don't use TextEdit myself, or work much in RTF, so some of your more technical descriptions are lost on me. However, here are a couple of suggestions:
    Try starting up in Safe Mode. Here is what Safe Booting does: What is Safe Boot, Safe Mode? (Mac OS X)
    My second suggestion is to use Pacifist to extract TextEdit from the install disk and install it on your computer.
    Please post back with update or further questions.
    Good luck.
    cornelius

  • TextEdit - RTF Files Don't Display Accurately

    Hi there
    I noticed that, when opening rtf files composed in MSWord (on Windows machines) the highlighted text does not appear as highlitghted when opening on TextEdit. Any tips or solutions?
    Thanks!

    I have found here that you can also try Abiword or NeoOffice, maybe Apple Pages for Word .rtf files.

  • Corrupted TextEdit RTF files

    I use TextEdit for taking reading notes, and the files I use keep getting corrupted. So far it has always been one file and one file only (at a time), and always an RTF file somewhere under my Reading Notes directory. I go in and repair the disk, and some days or weeks later another corrupt file shows up.
    The most recent one appears to have been overwritten with PDF data. TextEdit won't open it, but when I open it in Word as raw text it has a bunch of data like this:
    "<< /Type /Page /Parent 9 0 R /Resources 3 0 R /Contents 2 0 R /MediaBox
    [0 0 612 792] >>
    endobj
    3 0 obj
    << /ProcSet [ /PDF /Text ] /ColorSpace << /Cs1 5 0 R >> /ExtGState"
    I have no idea if this is a disk problem, a problem with TextEdit, a problem with another piece of software, or an OS X problem. Any suggestions?
    Macbook 13"   Mac OS X (10.4.8)  

    I have found here that you can also try Abiword or NeoOffice, maybe Apple Pages for Word .rtf files.

  • RH 7 creates impossibly large RTF file

    I'm trying out RH 7 on XP, using Word 2003. It works fine for
    small files. When I try to import a large (27 MB) Word file with
    many graphics, RH creates an RTF file that is 2.1 GB. I don't have
    the time to wait to see if Word can save it. Is there a workaround
    for this?

    Here's a more detailed description of what I see; perhaps it
    will evoke some response.
    1. In RoboHelp for Word, I import a large Word document,
    saving it in the project directory.
    2. I am asked whether I also want to save the document
    template. I do.
    3. Graphics are converted.
    4. The "Converting style to topic" message appears repeatedly
    until Word runs out of memory. I am warned that no "undo" will be
    possible; I answer "Yes" to proceed anyway.
    5. The conversion apparently proceeds. But a check of CPU
    usage says there’s nothing happening. I must cancel both Word
    and RoboHelp.
    Left behind is the .doc file (which was a huge 27 MB) and the
    .rtf file RoboHelp created (which is 77 times bigger still).
    Bruce

  • I can't open rtf files created using the 'touch' command in Terminal

    I don't know much about CLI but I like to play with my tech. When I create an RTF file using
    touch foo.rtf
    it creates the file but when I try and open it, it just says "The document “foo.rtf” could not be opened."
    What's the deal?

    Answered Here on StackOverflow:
    As you've likely discovered, touching a nonexistent file will create a zero-byte file with the name you specify. (touch is also used to update the modification time on an existing file. Seeman touch for further details.)
    The problem you're running into is that though a completely empty file is valid HTML, text, or Markdown, it is not valid RTF—this is true of many file formats, actually, which are structured in a particular way and require some data to be present be valid.
    Based on my experimentation, the bare minimum RTF file appears to be
    {\rtf1}
    If you'd like to create a blank RTF file from the shell, try this:
    echo '{\rtf1}' >Foo.rtf
    Note the above will overwrite Foo.rtf if it exists.
    Thank you user Zigg

  • Print RTF file within app

    Hi
    Is it possible to print an rtf file from within java app without actually viewing the file on screen? I don`t want to display the file in a jtextpane or jeditorpane. Simply want to print the file like you can with a straight text file.
    Or, is there are a command line switch to print a rtf file? through ms word?
    Any help would be appreciated.
    Thanks
    Kelly

    printing RTF files from java is amazingly hard. if not impossible.
    (just what you wanted to hear)
    basically, rtf support in java is pathetic.
    in my case, i had to create an actual RTF file in ms word and save it.
    i then opened it in notepad so that i could see all the control codes.
    then i cut and pasted each section of the document template so that each bit was a string constant in java. the bits that i wanted to add i generated in code the normal way.
    then i stuck all the bits back together again in one string and sent that off to a data stream. (to answer your question, it never went to the screen, just to the data stream)
    its a bloody stupid way of doing rtf, but it was the only way to get it to work without having to go through and figure and implement out all the rtf codes yourself.

  • Create rtf file, open in textedit

    i am very new to applescript, if anyone would have mercy, please respond.
    i am trying to create a script that will create a rich text file named by the date (in format of YY.MM.DD for purposes of sorting alphabetically) and open this file for edit in textedit. Preferably, I would like to be able to create a file named by date followed by a short description (for example, activate script - it asks for a summary and then creates a file named by date followed by a summary (for example "07.12.28 - this is an example") and opens that file in textedit.app for editing).
    i worked a lot with iptscrae but it's been a long time...and was nothing like this.
    edit: please note, i've had trouble with spaces in scripts when it deals with file names (date - summary)
    Message was edited by: eightyfiveonions
    Message was edited by: eightyfiveonions

    This is your script after I altered it a bit (and as you'll see it's for the purposes of journaling)
    I'm not sure exactly why I moved the current date and return instructions back to the bottom here but that's what I had to do to get it to work. I'm a trial and error learner more than anything else, I'm going to read up on this a bit but it's working like a charm.
    I guess it was because I set TheText variable back up for the RTF formatting and couldn't figure out how to incorporate the date there.
    edit: the formatting on this post is a bit messed up.. your rtf formatting stuff is moved from location in first script to accommodate the second script but nothing else is different about it. shrugs
    <pre title="this text can be pasted into the Script Editor" style="font-family: Monaco, 'Courier New', Courier, monospace; font-size: 10px; padding: 5px; width: 720px; color: #000000; background-color: #E0E0E0; overflow: auto">-- get the current date text
    tell (current date) to get ((its year) * 10000 + (its month) * 100 + (its day)) as text -- yyyyMMdd
    tell the result to set TheDate to text 3 thru 4 & "." & text 5 thru 6 & "." & text 7 thru 8 -- yy.mm.dd
    set TheFolder to "OSX:Users:joseph:Documents:Journal:" -- or set TheFolder to (choose folder)
    set TheName to text returned of (display dialog "Enter the name for the new document:" with title "New text document" default answer TheDate & " - " buttons {"Cancel", "OK"} default button "OK")
    set TheFile to (TheFolder & TheName & ".rtf") as text
    set TheText to "{\\rtf1\\mac\\ansicpg10000\\cocoartf824\\cocoasubrtf440
    {\\fonttbl}
    {\\colortbl;\\red255\\green255\\blue255;}
    \\margl1440\\margr1440\\vieww9600\\viewh8400\\viewkind0
    try -- create a new text document
    tell application "System Events" to get exists of file TheFile
    if not (the result) then
    set TheOpenFile to open for access TheFile with write permission
    write TheText to TheOpenFile as «class utf8» starting at eof
    close access TheOpenFile
    else
    display alert "The file \"" & TheFile & "\" already exists" as critical
    error
    end if
    on error
    try
    close access TheOpenFile
    end try
    return
    end try
    tell application "Finder" to set extension hidden of (TheFile as alias) to true
    tell application "TextEdit" -- open the file and print date
    activate
    open file TheFile
    set the text of document 1 to ((current date) as text) & return
    end tell</pre>
    Unless u see any errors with what I've done, I'm going to run with it.
    Message was edited by: eightyfiveonions

  • Textedit won't open .rtf files

    My boss wants me to open some .rtf files and convert them to word documents, but when I try to open the files text edit says it can't open them. What could be wrong?

    There may be something odd about them. Can TextEdit create and then read its own rft files?
    Anyway, you may do better to download NeoOffice (free) which may do better at opening them and can save in MSOffice format.

  • Applescript - Create RTF File in Last Selected Finder Folder

    QUERY: As a fit-for-purpose Applescript user, I try to customize posted scripts (thanks to sharers who do the heavy lifting) to suit my needs. Someone posted a great Applescript for creating an RTF file, but I want one modification:  rather than having to declare/designate a folder in which to place the new RTF, I want it to create the new file in the active Finder file.  Interestingly enough, I also have an Appscript which, in fact, will create a TXT file (not RTF) in the active Finder file. How to take the desirable bit from the latter and working it into the former, I cannot figure. (More times than not, I can successfully blend scripts, but not so this time. I have hit something that requires expert help.)
    REFERENCE MATERIAL: First, the current Applescript for creating an RTF. Then, for reference, the Applescript for creating the TXT.
    Kind regards,
    Obenreizer
    =========start RTF creation applescript==========>
    tell (current date) to get ((its year) * 10000 + (its month) * 100 + (its day)) as text -- yyyyMMdd
    tell the result to set TheDate to text 3 thru 4 & "." & text 5 thru 6 & "." & text 7 thru 8 -- yy.mm.dd
    -- QUERY: CAN THIS BE CHANGED TO THE ACTIVE FINDER FOLDER?
    set TheFolder to choose folder
    -- or can assign a specific "path" (including quotation marks)
    set TheName to text returned of (display dialog "Enter the name for the new document:" with title "New text document" default answer TheDate & " - " buttons {"Cancel", "OK"} default button "OK")
    set TheFile to (TheFolder & TheName & ".rtf") as text
    set TheText to "{\\rtf1\\mac\\ansicpg10000\\cocoartf824\\cocoasubrtf440
    {\\fonttbl}
    {\\colortbl;\\red255\\green255\\blue255;}
    \\margl1440\\margr1440\\vieww9600\\viewh8400\\viewkind0
    try -- create a new text document
        tell application "System Events" to get exists of file TheFile
        if not (the result) then
            set TheOpenFile to open for access TheFile with write permission
            write TheText to TheOpenFile as «class utf8» starting at eof
            close access TheOpenFile
        else
            display alert "The file \"" & TheFile & "\" already exists" as critical
            error
        end if
    on error
        try
            close access TheOpenFile
        end try
        return
    end try
    tell application "Finder" to set extension hidden of (TheFile as alias) to true
    tell application "TextEdit" -- open the file and print date
        activate
        open file TheFile
        set the text of document 1 to ((current date) as text) & return
    end tell
    <=========end RTF creation applescript==========
    =========start TXT creation applescript==========>
    tell application "Finder"
        try
            set fileName to "untitled"
            set fileExt to ".txt"
            set thisFolder to the target of the front window as alias
            tell application "System Events"
                set fileList to get the name of every disk item of thisFolder
            end tell
            set newFile to fileName & fileExt
            set x to 1
            repeat
                if newFile is in fileList then
                    set newFile to fileName & x & fileExt
                    set x to x + 1
                else
                    exit repeat
                end if
            end repeat
            make new file at thisFolder with properties {name:newFile, file type:"TEXT", creator type:"ttxt"}
            --{TO HIGHLIGHT CREATED FILE:  select one one of the next three choices}
            --select (every file of target of front window whose name contains "untitled")
            --select (first file of target of front window whose name contains "untitled")
            select (last file of target of front window whose name contains "untitled")
        on error errMsg
            display dialog (errMsg)
        end try
    end tell
    <=========end TXT creation applescript==========

    Well, copy the above file into this file where the files is created.  See my comments.
    =========start TXT creation applescript==========>
    tell application "Finder"
        try
            set fileName to "untitled"
            set fileExt to ".txt"
            set thisFolder to the target of the front window as alias
            tell application "System Events"
                set fileList to get the name of every disk item of thisFolder
            end tell
            set newFile to fileName & fileExt
            set x to 1
            repeat
                if newFile is in fileList then
                    set newFile to fileName & x & fileExt
                    set x to x + 1
                else
                    exit repeat
                end if
            end repeat
    -- Here is the line where the text file is create.  it is in folder thisFolder  seems the name is in newFile.
            make new file at thisFolder with properties {name:newFile, file type:"TEXT", creator type:"ttxt"}
            --{TO HIGHLIGHT CREATED FILE:  select one one of the next three choices}
            --select (every file of target of front window whose name contains "untitled")
            --select (first file of target of front window whose name contains "untitled")
    -- don't know what this line is doing, but I suppose it is highlight the new file since it is named untitled.txt
            select (last file of target of front window whose name contains "untitled")
        on error errMsg
            display dialog (errMsg)
        end try
    end tell
    <=========end TXT creation applescript==========

  • Got problems with creating RTF-files after OSX update

    Hi
    I don't know if this is really a MAC OS problem, but it occurred after I updated to 10.5.2 - so it's a likely suspect.
    Since the update I can't create RTF-files any more with Final Draft, my script writing program. A file is created, but when I try to open it I get an error message that it cannot be found. But the file is there: I can see it and click on it. It just won't open.
    Only today now I got the same error message with a doc-file I downloaded some months ago.
    The only big change I lately made to my Mac was the update to 10.5.2 and I got the new Office 2008 (both are the German versions). Could the problem come from either of them? I contacted Final Draft's support - they didn't know of the problem.
    Maybe someone else in this forum has encountered similar problems?

    Have you tried to Repair Permissions using Disk Utility?
    1. Open Disk Utility in your Applications/Utility folder.
    2. Click on the icon for your boot volume.
    3. Click on the First Aid tab and select Repair Permissions
    4. Click the repair permissions button.
    This is the first thing to try whenever any program goes wonky. It's free, but takes awhile for all the files that have to be checked and changed.

  • Xml publisher enterprise!!! create rtf file dynamically with load xml data

    i am new to xml publisher enterprise , i want a solution for this question ...
    i want create rtf file dynamically with loading xml data....means i wrote a program in jsp where the the output in xml file simultaneously create rtf file..but i enable load the xml data in rtf file but when i goto rtf file from where data in that load xml then it genrate the columns..but i want in dynamiclly to load the data will you please guide me ......

    Hi Atiq
    Im not quite clear on the requirement here:
    1. Do you just want to be able to extract the data and apply a template to the XML data from your jdp and render output?
    If so then you can use the XMLP APIs ... the are in the user guide. Particularly:
    RTFProcessor - converts RTF template to XSLFO stylesheet
    FOProcessor - takes, XML data, XSLFO stylesheet and output format and generates the required output.
    2. Do you want a template that will accept any data and just format it into rows and columns ? This can be written but your XML structure is going to have to be static, the data of course can be dynamic.
    Regards, Tim

  • Unable to combine microcsoft word or rtf files when creating a .pdf

    We cannot add microsoft word or .rtf files when trying to combine them into a single .pdf file..
    When you click on Add files..the word or .rtf files are greyed out and you
    cannot select them..
    We are using Mountain Lion OS (ltatest version) and adobe acrobat version 10.1.5

    Before Acrobat XI, it was only possible in Windows, not on a Macintosh.
    http://indesignsecrets.com/new-acrobat-xi-and-reader-xi-can-change-workflows.php
    "In previous versions of Acrobat, Mac users were stymied when you wanted to open a Microsoft Word, PowerPoint, or Excel file into Acrobat to convert it to PDF, or to include these files when combining documents together. Now, if you have Microsoft Office installed on your Mac, you can include these files. (There are still no PDF Maker plug-ins installed on the Mac, and hyperlink and bookmark export from Word is not yet supported.)"

  • Creating RTF file

    Hi all,
    We are trying to send a RTF file (with images) in the response. For this, first a RTF file has to be generated at server and then written to the response. How can we write a file in RTF format (with images)?
    Can anybody throw some light please?
    Regards,
    Mohan

    Hello,
    Maybe these will help:
    http://www.jfor.org/
    http://xml.apache.org/fop/
    http://jakarta.apache.org/ecs/
    Cheers,
    Kare

  • Blank/Generic Icons for Word & RTF files - a rant

    I can't understand why such a simple thing can be made so difficult. If you have .RTF and .DOC files all set to open with Pages, then they have the blank/generic icon. Ofcourse you can change the icon manually but this isn't exactly a solution as you would need to do it everytime you create a new file.
    What also gets me is that if you did happen to have WORD on your machine, and you still wanted .doc files to open with pages, the icon for those files would still be blank even though there's an icon right there on your machine especially for those types of files. The only way to get a word icon for word files is to have them opening all the time with Word.
    This is the same with RTF files, textedit has an icon for RTF files, but because you want to edit them in Pages you have to put up with a blank icon because there isn't an icon for RTF files inside the Pages package.
    I know Mac users tend to scoff at Windows users and vica versa. But, in this instance it's laughable that such a simple thing is made almost impossible to the average user.
    It's not much to ask, the ability to specify that all .doc and .rtf files have X icon.

    I think the logic is that Pages doesn't ever "save" .doc or .rtf. Pages can "export to", but that's not good enough for some reason.
    You cannot say: "This .rtf is a Pages rtf-file. I use Pages do open it and Pages to save it." The only thing you can say is "This .rtf will open with Pages, and then I will have to choose myself which format to save or export to."
    One doesn't have to agree with that logic of course.

Maybe you are looking for