|
Web Publish (Word Processing) |
|
2000.09.15 |
http://www.barefeetware.com/appleworks/web_publish_wp/ |
|
Description |
This Web Publish script improves on AppleWorks built in HTML export translator by fixing some bugs and adding features to the created web page. |
|
Enhancement Pack |
This is one of the 40 scripts bundled in the Enhancement Pack for AppleWorks. |
|
Web Publish |
This other script allows you to publish your AppleWorks database document with a web search form and search engine. |
|
AppleWorks Web |
Read some gotchas and guidlines for publishing web pages from AppleWorks. |
|
Detail
This Web Publish menu item is in the Word Processing sub menu in the Scripts menu.Sample
This script saves the active word processing document using AppleWorks supplied HTML translator, and enhances the output. This version:
- Deletes any existing image output files to avoid the Overwrite Images dialog after initiating a save.
- Replaces spaces in the file name with an underscore.
- Inserts the title, keyword and description META tags from the documents Properties (File Menu). These META tags improve the relevance of search engines. AppleWorks 6 only.
- Removes the border from exported images so linked images do not have a blue border.
- Removes the empty border from table cells.
- Removes the width from tables that fill most of the page, so they adjust to each web browsers window.
- Fixes the restarting of ordered lists after a sub point.
- Consecutive tables are joined (since AppleWorks can only show one per page).
- Allows alternate image URL prefix. For instance, you can store images on a faster external server.
- After saving as HTML and choosing image prefix the first time, it stores these per document in the Properties:Category field.
- If the folder containing the HTML file has the same name as the saved HTML file, then it renames the file as index.html. So, if you save the HTML to a file products.html in a folder products, it will rename as index.html, so a simpler URL products/ works in the web browser.
- Replaces <U><BR> with <BR>, to correct an AppleWorks bug that underlines continuously.
This web page and this entire site are examples of output from this script.Requirements
Operates on the front document, which must be a word processing document.Known Limits/Bugs
This script works with AppleWorks 6 and AppleWorks 5.
Only registered users are permitted to use the supplied files after 14 days.
Mac OS 9 has an AppleScript bug that sometimes prevents background applications from processing requests. This sometimes affects the creation of the search page. If the beachball stops spinning when running the Web Publish script, try clicking the Finder (eg the desktop) to bring it to the front and the script should proceed.Advanced
Upcoming versions of this script will address more of the bugs and wishes of AppleWorks web publishing. Tell us what you want.Scripting
This script is run only. Here are some important lines from the code:©2000 BareFeetWare
tell front document
set sourceTitle to title
set sourceKeywords to keywords
set sourceDescription to description
...
tell anyLib
set convertedName to (ReplaceEach of sourceName by newNameChars instead of oldNameChars) & ".html"
set newFile to new file with prompt "Save as web page:" default name convertedName
set htmlPath to newFile as text
set htmlName to PullItem of htmlPath at -1 between ":"
set htmlContainerPath to ContainerPath(htmlPath)
end tell
tell application "AppleWorks 6"
save sourceDoc in newFile using translator "HTML"
end tell
...
set htmlText to read newFile