Simple AppleWorks script doesn't work

I’m trying to convert an AppleWorks DB file into ASCII text and the following script is not working. It opens the DB, saves the file and quits, but the saved file is not in TEXT format, it appears to be in standard AppleWorks format.

tell application "AppleWorks 6" 
open "Macintosh HD:Users:langdon:Desktop:Movie DB.cwk" 
save in "Macintosh HD:Users:langdon:Temp:Movie DB.txt" as file type text 
end tell


Welcome to Wonderful World of AppleWorks Scripting!! It is a small and psychotic group, but we all love free software, even if it is quirky to script.

You were very close. Add one more command to your third line, telling AW to use a translator to ASCII text:

save in "Macintosh HD:Users:langdon:Temp:Movie DB.txt" as file type text using translator "ASCII text"

That works beautifully for me; hope it does as well for you.

Craig Smith

Thanks, Craig, that worked perfectly.

Weird. That wasn’t enough here (although I’d have expected it to work fine). Had to change the creator type. Still, as long as it works there… :slight_smile:


What do you mean by creator type? You should be able to save any type of AW document as any format that is supported by the installed translators. I am sure you know this already, but the following script will tell you which translators you have:

tell application "AppleWorks 6"
	export translators
end tell

Maybe yours is case sensitive??


Yes thanks, Craig - I’m aware of AppleWorks’ import and export translators (in fact, they’re what I tried right away). The problem I was getting was that, after translation, the converted file would still open in AppleWorks - but as a spreadsheet - rather than in, say, TextEdit as a text file.

After further digging around today, it turns out that some of my system settings were shot - something I’ve now fixed.

Oh yeah - my reference to ‘creator type’ simply means that I resorted to using Finder to force a change from “BOBO”, the creator type of AppleWorks (and ClarisWorks before it) - to “ttxt” (originally TeachText, then SimpleText and now TextEdit). To do this, I added an additional line that went something like:

Thankfully, while that did the trick temporarily, it’s no longer necessary - so all’s well that ends well. Apologies if my comment caused any confusion. :slight_smile:

Thanks for the update. No confusion here, simply looking for another ‘crumb’ to add in my little sack of Mac Nuggets. Useful information is found in the most amazing places, sometimes.

If it is not too much to ask, how does one determine that one’s system settings are incorrect? I am dealing with an annoyance right now that I have not had time to telephone Apple about. (At least not during normal business hours) Ever since I upgraded to Tiger, I cannot get the command:

man -k (something)

to function in my Terminal. It is driving me totally insane, as that was something I found extremely useful for learning some cool UNIX commands and scripts.

Craig Smith

Some things are obviously easier to determine than others, Craig. One of the best ways is to compare notes with other users - as we often do around here.

For example, my recollection was that the translations performed by AppleWorks worked fine. Without your contribution, I might have assumed that something had recently changed or broken in Appleworks or Tiger. As it was, I was encouraged to dig around a bit more to check out the behaviour on my machine in particular. In this case, both diagnosis and remedy were pretty straightforward. Somehow, AW had inexplicably become the default application for .txt files - easily fixed by resetting the default application from a file’s info window.

Yeah - know what you mean. When you’ve become accustomed to using a feature, it can be completely frustrating to lose it again. I just tried the man -k command to cross-check your experience (Terminal version 1.5, Mac OS version 10.4.2) - and it works OK here.

Not sure I can help very much with trouble-shooting this one - although the man -k (something) command is supposed to be the equivalent of apropos (something). Does apropos work for you? If so, it might buy you some time while you try to find out where man -k wandered off to…

Good luck! :slight_smile:


Thanks for taking the time to respond, I appreciate your insight. Here is the funny part. The only thing I could think of (in relation to the man -k issue with Terminal) was finally installing the Developer Tools on the Tiger disk. As per usual, it makes not a whit of sense, but now I have my man -k (and apropos) funtionality returned. I am so glad I only do this stuff for fun.

Craig Smith

It doesn’t make that much sense, does it Craig? Still, I’m delighted to hear that the issue is resolved! :slight_smile: