Re: Convert Appleworks to Word documents
Re: Convert Appleworks to Word documents
- Subject: Re: Convert Appleworks to Word documents
- From: Rick Davis <email@hidden>
- Date: Mon, 28 May 2007 10:25:04 -0400
On May 25, 2007, at 3:00 PM, Steve wrote:
Message: 2
Date: Fri, 25 May 2007 10:58:03 -0700
From: Steve Ingram <email@hidden>
Subject: Convert Appleworks to Word documents
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
As usual, this seems like it should be straight forward, but I am
stuck.
I'm trying to convert many Appleworks word documents to Microsoft
Word documents with Automator.
So far I can open each item in Appleworks and get the "Save As"
dialog box.
I don't see a way to have Appleworks save as "Word Mac 98, 2001
document" format.
I'm thinking that I may need to insert an Applescript in here, but I
can't make any headway with Applescript. (A limitation of my brain -
not Applescript.)
I have looked for a pre-made Automator workflow that would do this,
but the closest I have gotten is a workflow that converts a text file
to a doc file. These files are cwk files.
Any ideas?
Steve
Hi Steve,
Several years ago when our school district put a PC on every teachers
desktop I wrote an Applescript application to automate the conversion
of AppleWorks documents to Word documents. I have not used it or
tested it on newer versions of Word or OS X. But the language should
give you an idea of how to make it work. I am sure some of the
Applescript experts on this list serve can improve and consolidate
the script to make it even better. At the time I wrote this Windoze
didn't work well with file name lengths over 31 characters (including
the dot and extension) so there is language to truncate the file
name. I remember trying to add a filter to remove illegal characters
from the file name (characters allowed by Mac Classic OS, but not
Windoze), but I don't think I ever got it working quite right.
Let me know if the line breaks, etc don't hold up in this email and I
can send you the text file.
Hope this helps.
Rick Davis, ACHDS
thePRIMAXgroup
Cincinnati, OH
(513)910-9490
http://www.applehelp.org
property theTranslator : "Word Windows 97, 2000, XP 2002 "
try
tell application "Finder"
set thisFile to choose file
duplicate thisFile
if kind of thisFile is not equal to "Folder" then
set FileName to (name of thisFile) as text
set Filenamelength to length of FileName
set Suffix to ".doc"
if file type of thisFile is "CWWP" then
-- set currentPath to currentFile as text -- AW6 wants a path,
not an alias -- alias ref is ok
if FileName ends with ".cwk" then
set nameCount to count of characters in FileName
set FileName to ¬
(characters 1 through (nameCount - 4) of FileName as string)
end if
if Filenamelength > 27 then
set TopLimit to (Filenamelength + (27 - Filenamelength))
copy characters 1 through TopLimit of FileName as string to
NewFilename
set NewFilename to NewFilename & Suffix
else
set NewFilename to FileName & Suffix
end if
try
set the name of thisFile to NewFilename
on error
set name of thisFile to the text returned of (display dialog
"You have duplicate file names. Please rename this file. If the file
name entered here is already in use the operation will end and you
will need to check for any files not converted." default answer
NewFilename)
end try
end if
try
set theCounter to 0 -- initialized variable theCounter
tell application "AppleWorks 6"
activate
open thisFile -- alias reference is ok
save thisFile using translator theTranslator with NewFilename --
fixed the reference
close front document without saving
set theCounter to theCounter + 1
end tell
on error theError
display dialog theError
end try
else
(display dialog "This is not an Appleworks document and will not
be converted")
end if
end tell
end try
display dialog "Congratulations! " & (theCounter as string) & " files
have been converted from AppleWorks 6 file format to Microsoft Word
file format." buttons {"OK"} default button 1
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Automator-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden