RTF doc set --> HTML doc set
RTF doc set --> HTML doc set
- Subject: RTF doc set --> HTML doc set
- From: Mahlon Lovett <email@hidden>
- Date: Fri, 12 Oct 2007 15:41:45 -0400
- Thread-topic: RTF doc set --> HTML doc set
(*
Earlier in the summer, I asked this group for advice in how to write a
script for MS Word to generate multiple Web page output from Rich Text.
There was one helpful reply that pointed me in the right direction. After
further experimenting, here's a script that works for me. The hard part was
getting the precise format of the 'save as' -- not as clear as it might be
in the Word Scripting Guide available from MS...
*)
(*
script to copy and paste into script editor. Starting point: Finder
selection is a folder containing [.rtf] documents. These might have been
generated using InDesign, for example. BTW, careful use of paragraph styles
can lead to pretty clean Word HTML output (i.e., 'Normal (Web), 'Heading 1',
'Heading 2', etc. --> <p>, <h1>, <h2>, etc. As for bold, fonts, it's still
pretty much a mess...:()
*)
on run
tell application "Finder"
set sel to the selection as alias
set L to every file of sel as alias list
end tell
repeat while L is not {}
set F to item 1 of L
set L to rest of L
tell application "Finder"
set nfn to my fc((F as string), ".rtf", ".htm")
end tell
tell application "Microsoft Word"
open (F as string)
save as active document file name nfn file format format HTML
close active document saving no
end tell
end repeat
end run
on fc(x, b, g)
set tid to text item delimiters
set text item delimiters to b
set x to text items of x
set text item delimiters to g
set x to x as string
set text item delimiters to tid
return x
end fc
(*
Mahlon Lovett, Princeton, NJ
*)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden