Skip navigation

Save Pages file as html?

5334 Views 12 Replies Latest reply: Oct 22, 2013 2:02 PM by toaster_mac84 RSS
jhicks124 Calculating status...
Currently Being Moderated
Jul 10, 2012 6:36 AM

In Word it is very easy to save the file as html. Can you do this with pages 11?

Macbook Pro, Mac OS X (10.6.7)
  • Tom Gewecke Level 9 Level 9 (70,815 points)
    Currently Being Moderated
    Jul 10, 2012 7:07 AM (in response to jhicks124)

    No.  TextEdit can do it, however.

  • jgoshawk Level 1 Level 1 (10 points)
    Currently Being Moderated
    Jul 22, 2012 11:51 AM (in response to Tom Gewecke)

    How does textedit do this, now that Lion has no "save as" command? I've tried the new method (duplicate then save) but there are no options I can find for saving in html.

     

    tks,

    JS

  • Tom Gewecke Level 9 Level 9 (70,815 points)
    Currently Being Moderated
    Jul 22, 2012 12:00 PM (in response to jgoshawk)

    jgoshawk wrote:

     

    I've tried the new method (duplicate then save) but there are no options I can find for saving in html.

     

     

    When I do duplicate then save, I get a File Format button which has Web Page (.html) among the options.

     

    For a new document, which has not yet been saved, I get the same thing with Save.

  • jgoshawk Level 1 Level 1 (10 points)
    Currently Being Moderated
    Jul 22, 2012 12:42 PM (in response to Tom Gewecke)

    Huh. I don't get a File Format button. The only pull-down is a Plain Text Encoding button:

     

    Screen Shot 2012-07-22 at 2.38.27 PM.png

  • Michael Wasley Level 5 Level 5 (6,810 points)
    Currently Being Moderated
    Jul 22, 2012 12:50 PM (in response to jgoshawk)

    Have you tried Format > Make Rich Text first?

  • Peggy Level 8 Level 8 (38,085 points)
    Currently Being Moderated
    Jul 22, 2012 12:53 PM (in response to jgoshawk)

    Screen Shot 2012-07-22 at 12.52.32 pm.png

     

    Peggy_sig.png

  • jgoshawk Level 1 Level 1 (10 points)
    Currently Being Moderated
    Jul 22, 2012 1:12 PM (in response to Michael Wasley)

    Yup, that's it. RTF first.

     

    Thanks!

     

    JS

  • eberkers Calculating status...
    Currently Being Moderated
    Dec 28, 2012 2:28 AM (in response to jhicks124)

    You can also export as RTF from Pages, then use the convert utility textutil in the Terminal. Locate the exported file, and type textutil -convert html foo.rtf (where the last argument is the filename you created with the export).

     

    For more info, type man textutil in the Terminal.

  • VikingOSX Level 5 Level 5 (4,695 points)
    Currently Being Moderated
    Dec 29, 2012 9:49 AM (in response to eberkers)

    Textutil is a useful utility.

     

    For those that do not wish to drop into Terminal, here is a short Automator Folder action. In its present form, dragging one or multiple of the supported input file types onto the designated folder, will convert each into a like-named .html file.

     

    Steps:

     

    1. Create an arbitrary named folder on your Desktop. It can be elsewhere.
      1. I named this folder: file->html
    2. Launch /Applications/Automator
      1. Select Folder Action and Choose.
      2. Select Actions > Utilities > Run Shell Script
      3. Drag and drop the Run Shell Script action into the larger workflow panel.
      4. Duplicate the content and settings from the following image in your action.
        1. Single-click to enlarge included image for improved clarity
      5. Save as file2html and exit Automator.
    3. Locate your folder that you want to apply this action too.
      1. Select the folder from step 1 with the right mouse button.
      2. At the bottom of the menu, select Folder Actions Setup...
        1. At the bottom of the list of actions, choose the action.workflow that you just saved from Automator.
          1. In my example, it is file2html.workflow
        2. Check the following:
          1. Enable Folder Actions
          2. Actions
          3. Your folder action name
          4. In the right panel, check On for your action
        3. Quit Folder Actions
    4. Drag and drop file(s) onto the folder from step 1 to convert to html.
    5. Open with web browsert to verify.

     

    Screen Shot 2012-12-29 at 12.29.39 PM.png

     

    I tested this by dragging and dropping three files together on to the folder: .rtf, .doc, and .odt.

     

    All converted into their respective named .html files and were legible in Safari.

  • VikingOSX Level 5 Level 5 (4,695 points)
    Currently Being Moderated
    Dec 31, 2012 12:06 AM (in response to VikingOSX)

    I have revised the previously posted folder action that converts supported textutil file formats into .html documents.

     

    The bash shell script now does the following:

     

    1. Compares dragged and dropped files against supported textutil file types for HTML conversion
    2. Converts valid files to HTML within the folder
    3. Invokes an AppleScript alert dialog from the bash shell that lists the invalid files encountered.

     

    Files tested, singularly and in multiples:

     

    1. Plain text - *.txt
    2. MS Word 2003 (WordML) - *.xml
    3. Revisable Text Format - *.rtf
    4. MS Word - .doc
    5. MS Word - .docx
    6. OpenOffice/LibreOffice Writer - *.odt

     

    Here is the revised automator workflow script:

     

    Screen Shot 2012-12-31 at 3.03.09 AM.png

  • VikingOSX Level 5 Level 5 (4,695 points)
    Currently Being Moderated
    Jan 1, 2013 2:18 PM (in response to VikingOSX)

    Errata:

     

    if [[ ${#invalidLen[*]} == 0 ]]; then

     

    should read:

     

    if [[ ${#invalid[*]} -eq 0 ]]; then

  • toaster_mac84 Calculating status...
    Currently Being Moderated
    Oct 22, 2013 2:02 PM (in response to VikingOSX)

    Textutil did it's job - thanks so much for walking through these steps.  I made a minor error in Automater by selecting the wrong destination file for the operation, but I caught the error and fixed it.

     

    Now to see if I can speed up the Cocoa HTML Writer engine to do conversion on a series of many files

Actions

More Like This

  • Retrieving data ...

Bookmarked By (1)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.