An AppleScript to mark files as WP documents with icon, file association, etc.
- No one really needs this, and there are existing AppleScripts that do much the same thing, but I enjoyed the challenge of writing it, so here it is.
If you have WP documents created by WPDOS or WPWin (or anything else) that display in OS X with a generic icon, and won't open automatically in whatever application you use to open WP files, then this AppleScript application can help.
If you drop a file or folder on it (or double-click it and select a file or folder), it will test whether the file (or all the files in the folder) are (1) actual WordPerfect documents (with the file "signature" in the first few bytes) and (2) NOT already identified by OS X as a specific document type such as DOC or TXT.
If both (1) and (2) are true, then the AppleScript application will set the "file type" of the document according to the details it finds in the file signature: WPMac 2.x files will be set to display in the Finder as WPMac 2.x files; WPMac 3-3.5.4 files will be set as WPMac 3.x files; WPMac 3.5 Enhanced files will be set as WPMac 3.5 Enhanced files. WordPerfect 5.0 will be set as WP 5.0 files; WP 5.1 files as WP 5.1 files; and WP 6.x and later files set as WPD files.
This means that the files will have the icons you expect and should open automatically when you double-click them.
This is a first version, and the AppleScript is probably riddled with errors, but I don't think it can do any harm. It won't touch any file that already has a "file type"; it makes absolutely NO changes in the file itself, only in the information that the Finder stores about the file. Read that last sentence again: this application does NOT change the actual file - only the Finder's record of the file.
Here it is:
- One reason I went to the trouble to write this script was that I had earlier put together a new set of OS X-style document icons to use for the WP files on my system in place of the old System-7-style icons that we've been living with for the past two decades or so.
These icons are now built into the current versions of all the AppleScript applications that I've put together for working with WP files, for example the WP Viewer at:
Here's an image of the icons themselves:
Anyone who wants them should feel free to make use of them. (By the way, I know that the ones for the older DOS file formats give the impression that the old documents can include images, which they can't. But I figured this out too late to do anything about it.)
- Apologies for cluttering the message board with updates. After posting the message below, I realized that the versions of my AppleScript applications that were downloadable for the past two or three days in fact caused some WP documents to appear with generic icons instead of the ones that I had built into the applications.
The current versions, I hope, fix this problem. If you downloaded any of these applications (WP Converter, WPLO Converter, WP Viewer, WPMacApp) in the past two or three days, and if your WP files display with generic icons, not WP-specific ones, then please download the latest versions.
--- In firstname.lastname@example.org, "em315" <em315@...> wrote:
> One reason I went to the trouble to write this script was that I had earlier put together a new set of OS X-style document icons to use for the WP files on my system in place of the old System-7-style icons that we've been living with for the past two decades or so.
> These icons are now built into the current versions of all the AppleScript applications that I've put together for working with WP files, for example the WP Viewer at: