Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > AW 5 File Converter

AW 5 File Converter
Thread Tools
angevine41
Junior Member
Join Date: Sep 1999
Location: Chico, CA
Status: Offline
Reply With Quote
Apr 4, 2000, 03:16 PM
 
AW 5 has a script that will convert CW 4 files to AW 5. It says, further:

"You can modify the script to automatically move the original files to the trash and delete them when done. The code is in the script, but it is commented out. Activate it at your own risk."

I admit to utter confusion about Applescript; can someone tell me, exactly, how to modify the script? (I have everything backed up on Zip, in case anything happens.)
     
Paul Crawford
Dedicated MacNNer
Join Date: Nov 1999
Location: Georgetown, Demerara, Guyana
Status: Offline
Reply With Quote
Apr 6, 2000, 01:59 AM
 
Hi:

If you're referring to the 'Convert Documents' applet that is located in the 'AppleWorks Scripts' subfolder of your 'AppleWorks 5' folder, you could proceed as follows:-
  • Open up the applet in the Script Editor application. (The Script Editor application is usually located in your 'Hard Disk : Apple Extras : AppleScript' folder.)
  • If necessary, scroll down until you see the 'printTheDocument' subroutine, which begins with the statement 'to printTheDocument(theFileName)'. [Yes, it has a strange name for a conversion subroutine, but I suspect that it started out as a clone of a similar subroutine in the companion 'Print Documents' applet.]
  • Near the end of the 'tell application "AppleWorks"' block, just after the 'close document 1...' statement, you'll see a commented-out inner 'tell' block that moves the current original file to the trash, and looks like this:-
    Code:
    (*tell application "Finder" move file MyName to trash end tell*)
    To activate this block, simply remove the paired comment-tokens -- i.e., '(*' and '*)' -- which surround it.
  • Also, at the very end of the subroutine, you'll see another 'tell' block that actually empties the trash, and looks like this:-
    Code:
    (*tell application "Finder" empty trash end tell*)
    As before, to activate this block, simply remove the paired comment-tokens.

BTW, in general, AppleScript comments are either prefixed by '--' [for a single-line comment], or surrounded by '(*' and '*)' [for a multi-line comment].

Regards,

--Paul

[This message has been edited by Paul Crawford (edited 04-06-2000).]
     
angevine41  (op)
Junior Member
Join Date: Sep 1999
Location: Chico, CA
Status: Offline
Reply With Quote
Apr 6, 2000, 07:05 AM
 
Paul,

Thanks! Wish I'd known how simple it was!

Just so I'm clear about how the script works: Once I remove the paired comment-tokens, if I drop a folder into that icon, it will go through the folder and update all AW4 docs to AW5, trash old versions, and leave other docs alone? (This is my 32MB personal folder, which has mostly AW4 text docs, but also a hodgepodge of other things.)
     
Paul Crawford
Dedicated MacNNer
Join Date: Nov 1999
Location: Georgetown, Demerara, Guyana
Status: Offline
Reply With Quote
Apr 7, 2000, 06:20 AM
 
Hi again,

Yes, that's generally how the script is supposed to work. It's designed to process all old CW/AW documents, including those in nested subfolders. It also incorporates a "filter" of file-types that supposedly screens out irrelevant files such as applications or Hypercard stacks (see the 'theExclusionList' variable, near the top of the 'printTheDocument' subroutine).

However, the script won't necessarily screen out other common documents such as Microsoft Word docs (file-type "WDBN"). If you don't want to convert such documents, you could either manually remove them from your personal folder prior to conversion, or add the appropriate file-types to the 'theExclusionList' variable, or add your own variable that would allow filtering on creator-types as well. [Some common four-character file-type and creator codes are listed in the Default File Suffix Mappings section of StarNine's online WebStar 4 Reference Manual. (In that table, note that '%20' represents a single space.) There's also an exhaustive listing available as shareware from The Type/Creator Database Website.]

Finally, as far as safety goes, you indicated that you already have a backup of your personal folder on a Zip cartridge. As an additional safeguard, if you want to be extra-cautious in terms of the script, you could activate only the first block that moves each old file to the Trash, but leave intact the other block that would actually empty the Trash. Then, after the conversion, you could retrieve your old AW/CW documents from the Trash, and store them somewhere as a second backup.

Regards,

--Paul

[This message has been edited by Paul Crawford (edited 04-07-2000).]
     
angevine41  (op)
Junior Member
Join Date: Sep 1999
Location: Chico, CA
Status: Offline
Reply With Quote
Apr 7, 2000, 07:26 AM
 
Whew, thanks for the (continuing) really comprehensive answers. Don't have any Word docs to be concerned about, and boy-oh-boy would I have a crammed trash can if I used that option!

Just for fun, I think I'll time the conversion, this weekend.

     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 05:27 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,