Loading ...
Sorry, an error occurred while loading the content.

1649Re: New to WPMac, Old WPDOS user

Expand Messages
  • Smokey Ardisson
    Feb 18, 2005
      --- In wordperfectmac@yahoogroups.com, "John Rethorst" <jrethorst@p...> wrote:
      >
      > --- In wordperfectmac@yahoogroups.com, Smokey Ardisson wrote:
      >
      > > one
      > > thing I have noticed is that WP-Mac requires documents to have
      > > Macintosh type codes (.WP6 or WPPC for WP6 docs), and depending on
      > > how the WP-DOS files are arriving on your Mac, the type codes might
      > > not be getting set. John R. can probably whip up a nice
      > > AppleScript…
      >
      > I don't know about a nice one, but try this. Save as an applet, not
      > showing startup screen:
      >
      > to run
      > display dialog "Drop a file on me to set its creator " & ¬
      > "to "WPC2" and its type to "WPPC"." buttons ¬
      > {"OK"} default button 1 with icon note
      > end run

      FYI, I had Script Editor complain about the quotes around WPC2 and WPPC in the above on run block; I changed them to single quotes and the script compiled.

      John, is yours supposed to handle multiple items in a single drop?

      I also discovered the stupid error that was keeping the script I was working on from working, so I present my solution below. John R's script is a lot more sophisticated (it has all the error reporting and "don't double-click me or give me folders" stuff), and there are probably other ways in which it is better than mine (I'm very much an amatuer still). However, I have one check he doesn't include :-) which might help if one has WP files stuck among other assorted files (but not if the DOS WP docs don't have extensions!). If your DOS WP files have different extensions, just add or modify the list--omitting the period! :-)

      As with John R's, save as an applet without showing startup screen. (The savvy AppleScripter can incorporate the extension-checking scheme into John R's for complete coverage!)

      Smokey

      --set type/creator on PC WP files so WP-Mac can open them properly
      --only act on files with extensions indicating likely Win/DOS WP file

      property extensionList : {"wpd", "wp", "wp5", "wp6"} ¬
      --needs to exclude the period!

      on open fileList
      repeat with theFile in fileList
      tell application "Finder"
      if the name extension of theFile is in the ¬
      extensionList then
      set file type of theFile to "WPPC"
      set creator type of theFile to "WPC2"
      end if
      end tell
      end repeat
      end open
    • Show all 10 messages in this topic