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

[ANN] Open WP Files 1.0

Expand Messages
  • jrethorst
    Double-click on a WP file in OSX. This program automatically switches to SheepShaver or Basilisk and opens the file in WP. Find a WP file using Spotlight. Your
    Message 1 of 25 , Feb 8, 2010
    • 0 Attachment
      Double-click on a WP file in OSX. This program automatically switches to
      SheepShaver or Basilisk and opens the file in WP.

      Find a WP file using Spotlight. Your Mac switches to SheepShaver or Basilisk
      and the file opens in WP.

      WP files show their correct icons in OSX.

      This is a significant step towards integration of WP in SheepShaver or Basilisk
      with OSX, and is at times breathtaking.

      The only limitation is that WP files have to be in the shared folder, e.g. your
      Home folder or Documents folder, or whatever folder you designated in
      SheepShaver or Basilisk prefs.

      Many thanks to Smokey Ardisson for his contribution to this. Ed, you are
      more than welcome to include this with WP Appliance and WPMacPPC.

      Free in the Files section here, as "Open WP Files 1.0.zip".

      John R.
    • em315
      Terrific work! One very small point. Under Snow Leopard the line that reads tell application Finder to move file ((desktop as string) & transferData ) to
      Message 2 of 25 , Feb 8, 2010
      • 0 Attachment
        Terrific work! One very small point. Under Snow Leopard the line that reads

        tell application "Finder" to move file ((desktop as string) & "transferData") to folder dataFolder with replacing

        should read (I think):

        tell application "Finder" to move file ((path to desktop as string) & "transferData") to folder dataFolder with replacing

        Otherwise, I get an error message: "Can't get file 'Macintosh HD:Users:edward:DesktoptransferData' of application 'Finder'."

        I don't know if this applies to other OS X versions.

        This is very, very nifty. Thank you!

        --- In wordperfectmac@yahoogroups.com, jrethorst <no_reply@...> wrote:
        >
        > Double-click on a WP file in OSX. This program automatically switches to
        > SheepShaver or Basilisk and opens the file in WP.
      • jrethorst
        ... [rant] Why does Apple keep changing Applescript syntax? I d think they d learned with Applescript 1.7, which broke about half the scripts existing at that
        Message 3 of 25 , Feb 9, 2010
        • 0 Attachment
          --- In wordperfectmac@yahoogroups.com, "em315" <em315@...> wrote:
          >
          > Terrific work! One very small point. Under Snow Leopard the line that reads

          [rant]
          Why does Apple keep changing Applescript syntax? I'd think they'd learned
          with Applescript 1.7, which broke about half the scripts existing at that time.
          I appreciate what looks like an attempt at increased consistency, since
          Scripting Addition commands use "path to desktop", but I'd think they
          could have the Finder recognize legacy syntax. This happened when I wrote
          the installer: the last time I scripted the desktop it was "content space
          of desktop"; now it's "container window of desktop". Who knew?
          [/rant]

          > This is very, very nifty. Thank you!

          You're most welcome. Update free in the Files section, as Open WP Files 1.0.1.zip.

          John R.
        • em315
          John, These are terrific scripts. On the principle that it s always better to avoid cluttering up one s desktop and file system with files and folders that one
          Message 4 of 25 , Feb 10, 2010
          • 0 Attachment
            John,

            These are terrific scripts. On the principle that it's always better to avoid cluttering up one's desktop and file system with files and folders that one doesn't need to see, I've tried rewriting the sripts so that they use only hidden (invisible) files and folders. I think I've got it working fairly well, with the only problem being that the SheepShaver-based script seems to take a moment or two extra at the end. (In that script, I needed to use the Finder to delete the file with the data, because the Jon's Commands delete command doesn't seem to know how to remove a hidden file in the Unix folder. Maybe there's another OSAX that can do this without activating the Finder?)

            Anyway, the versions I've put together here use a completely different directory structure and filename from the ones you use, so it shouldn't get in the way of your system if you want to try it out. If anything in it is useful, please improve it for your own use. Instead of your SheepShaver Data folder, I use .WPTransfer (the dot at the start makes it invisible, of course), and instead of transferData, I use wpFileList.

            Here's the zip with the two files:

            http://dl.dropbox.com/u/271144/OpenWPFilesEM.zip
          • em315
            Actually, now I see that Jon s Commands WILL delete the hidden file - I merely had to specify the path as a string, instead of using an alias. It s too late to
            Message 5 of 25 , Feb 10, 2010
            • 0 Attachment
              Actually, now I see that Jon's Commands WILL delete the hidden file - I merely had to specify the path as a string, instead of using an alias. It's too late to modify the scripts now, but the way to do it will be obvious and I'll get around to it tomorrow.

              --- In wordperfectmac@yahoogroups.com, "em315" <em315@...> wrote:
              >
              > John,
              >
              > These are terrific scripts. On the principle that it's always better to avoid cluttering up one's desktop and file system with files and folders that one doesn't need to see, I've tried rewriting the sripts so that they use only hidden (invisible) files and folders. I think I've got it working fairly well, with the only problem being that the SheepShaver-based script seems to take a moment or two extra at the end. (In that script, I needed to use the Finder to delete the file with the data, because the Jon's Commands delete command doesn't seem to know how to remove a hidden file in the Unix folder. Maybe there's another OSAX that can do this without activating the Finder?)
              >
              >
            • em315
              Revised scripts now posted at the same link as before: http://dl.dropbox.com/u/271144/OpenWPFilesEM.zip
              Message 6 of 25 , Feb 11, 2010
              • 0 Attachment
                Revised scripts now posted at the same link as before:

                http://dl.dropbox.com/u/271144/OpenWPFilesEM.zip


                --- In wordperfectmac@yahoogroups.com, "em315" <em315@...> wrote:
                >
                > Actually, now I see that Jon's Commands WILL delete the hidden file - I merely had to specify the path as a string, instead of using an alias. It's too late to modify the scripts now, but the way to do it will be obvious and I'll get around to it tomorrow.
              • em315
                John s terrific Open WP Files scripts make it possible to open WPMac/SheepShaver as if it were an OS X application that edits WordPerfect files. It occurred to
                Message 7 of 25 , Feb 13, 2010
                • 0 Attachment
                  John's terrific Open WP Files scripts make it possible to open WPMac/SheepShaver as if it were an OS X application that edits WordPerfect files. It occurred to me - would it be possible to modify the script so that SheepShaver closes down automatically when you quit WordPerfect, making it even more like a standard application?

                  So I came up with this modified script, which might be named "~Open WP Files AutoShutDown". This is designed to replace the script in the Startup Items folder of the System Folder in SheepShaver itself; John's existing "Open WP Files" OS X AppleScript does not need to be changed.

                  To use this, I suggest removing all existing startup scripts from the Startup Items folder; restart SheepShaver. Launch this new script to see how it works. Make sure to test it before installing it in your Startup Items folder!

                  You can now start up SheepShaver/WP in two different ways. If you start up SheepShaver by double-clicking its desktop icon, it will start up and open WPMac with a blank document - just as if you were starting up WPMac on an old Mac. If, however, you start up SheepShaver by double-clicking a WP file in OS X, so that WPMac starts via John's "Open WP Files" Applescript, then WP will start with the document open, with no blank document window - exactly as it would start in an old Mac if you double-clicked on a WP file. When you quit WPMac, SheepShaver will also quit.

                  Here's the code; it should be saved in SheepShaver's Script Editor as an Application, with these options turned ON: Stay Open -and- Never Show Startup Screen. I'm not posting a compiled script just yet in case it causes problems that might be difficult for non-experts to deal with.

                  ----------------
                  -- Copyright © 2008-2010 by John Rethorst. All rights reserved. Free.
                  --osax: Jon's Commands
                  -- modified by Edward Mendelson for AutoShutDown
                  -- also to suppress empty window when opening existing file

                  global transferFolder
                  global transferDoc
                  global wpRunning
                  global cycles
                  property retSeconds : 2

                  on run
                  tell application "Finder"
                  activate
                  try
                  set transferFolder to (folder "OSX > SS" of folder "SheepShaver Data" of folder "Unix") as alias
                  on error
                  try
                  make folder at folder "Unix" with properties {name:"SheepShaver Data"}
                  on error
                  display dialog "Problem setting transfer folder."
                  quit
                  end try
                  try
                  make folder at folder "Unix:SheepShaver Data" with properties {name:"OSX > SS"}
                  set transferFolder to result as alias
                  on error
                  end try
                  end try

                  try
                  close window of folder "Unix:SheepShaver Data:OSX > SS"
                  on error
                  end try
                  try
                  close window of folder "Unix:SheepShaver Data"
                  on error
                  end try
                  end tell
                  set cycles to 1
                  end run

                  on idle
                  try
                  set doTransfer to true
                  tell application "Finder" to set transferDoc to item 1 of transferFolder as alias
                  on error
                  set doTransfer to false
                  --return 1
                  end try

                  if doTransfer is true then
                  openDoc()
                  else
                  if cycles is 1 then
                  tell application "WordPerfect" to activate
                  set cycles to 2
                  end if
                  end if

                  tell application "Finder"
                  tell application "Finder" to name of processes
                  if the result contains "WordPerfect" then
                  set appRunning to true
                  else
                  set appRunning to false
                  end if
                  end tell

                  if appRunning is false then
                  if cycles is greater than 5 then
                  -- tell me to quit -- use this for testing to avoid shutdown
                  tell application "Finder" to shut down
                  end if
                  end if
                  if cycles is less than 10 then
                  set cycles to cycles + 1
                  end if
                  return retSeconds -- number of seconds between tests for application running
                  end idle

                  on openDoc()
                  set tid to text item delimiters
                  set text item delimiters to return

                  set filePaths to (read transferDoc)
                  set fileList to text items of filePaths

                  tell application "WordPerfect"
                  launch
                  repeat with i from 1 to ((count items in fileList) - 1)
                  try
                  set thisFile to (item i of fileList as string)
                  open (thisFile as alias)
                  on error
                  display dialog "I could not open "" & thisFile & ""." buttons ¬
                  {"OK"} default button 1 with icon caution
                  exit repeat
                  end try
                  end repeat
                  end tell

                  try
                  deleteFile transferPath -- Jon's Commands
                  on error
                  tell application "Finder"
                  if exists file transferDoc then
                  delete transferDoc
                  end if
                  end tell
                  end try
                  set text item delimiters to tid
                  end openDoc
                • jrethorst
                  This is a good idea, and I ll incorporate it in a future update. No problem about the line breaks. Meanwhile, Smokey and I are working on making the OSX app
                  Message 8 of 25 , Feb 13, 2010
                  • 0 Attachment
                    This is a good idea, and I'll incorporate it in a future update. No problem about
                    the line breaks.

                    Meanwhile, Smokey and I are working on making the OSX app into a droplet --
                    or Smokey is, or I hope he is, since I don't have a clue how to make a bundle
                    into a droplet. I'm also putting together a basic set of macros to add to WP,
                    and trying to figure out why Adobe PS has suddenly started crashing
                    (although Laserwriter 8 works fine -- if you need to print, dl the Chooser
                    from Temporary Items in the Files section here and enable Laserwriter 8
                    in Extensions Manager). I should leave out the WP clip art -- it's not much
                    used anyway, I think, and the SS sparse disk image will load faster if there's
                    less on it. A little update to documentation, and we'll have an SS/WP install
                    we can live with for a while.

                    I want to research Ed's faster printing setup and Tom Rostafinski's
                    symbolic links findings, so WP will still be the best Mac word processor
                    there is.

                    John R.


                    --- In wordperfectmac@yahoogroups.com, "em315" <em315@...> wrote:
                    >
                    > John's terrific Open WP Files scripts make it possible to open WPMac/SheepShaver as if it were an OS X application that edits WordPerfect files. It occurred to me - would it be possible to modify the script so that SheepShaver closes down automatically when you quit WordPerfect, making it even more like a standard application?
                    >
                    > So I came up with this modified script, which might be named "~Open WP Files AutoShutDown". This is designed to replace the script in the Startup Items folder of the System Folder in SheepShaver itself; John's existing "Open WP Files" OS X AppleScript does not need to be changed.
                  • em315
                    Unless I m misunderstanding something, the OS X app already is a droplet. It certainly works as it should when I drop one or more WP files on it. Am I missing
                    Message 9 of 25 , Feb 13, 2010
                    • 0 Attachment
                      Unless I'm misunderstanding something, the OS X app already is a droplet. It certainly works as it should when I drop one or more WP files on it. Am I missing something? - Oh, I see - it needs to test whether the files are WP files or not, and whether or not you've dropped a folder on it - all that can go into the open block, presumably - create an array of file types and then something like:

                      on open these
                      repeat with this in these
                      -- test for WP file type, do the open stuff
                      end repeat
                      end open

                      But of course it's easy to write that kind of pseudocode - the hard part is actually getting to work, and I'm not sure I'm equal to that task.

                      --- In wordperfectmac@yahoogroups.com, jrethorst <no_reply@...> wrote:

                      > Meanwhile, Smokey and I are working on making the OSX app into a droplet --
                      > or Smokey is, or I hope he is, since I don't have a clue how to make a bundle
                      > into a droplet.
                    • jrethorst
                      ... Right you are! I m having some kind of system issue so the app doesn t highlight when I drag a file over it. Nonetheless it opens the file, unless the file
                      Message 10 of 25 , Feb 13, 2010
                      • 0 Attachment
                        --- In wordperfectmac@yahoogroups.com, "em315" <em315@...> wrote:
                        >
                        > Unless I'm misunderstanding something, the OS X app already is a droplet.

                        Right you are! I'm having some kind of system issue so the app doesn't
                        highlight when I drag a file over it. Nonetheless it opens the file, unless
                        the file is not in the shared folder, in which case it says so.

                        An alias of the app could be put on the desktop or the app can be
                        added to the Dock for convenience.

                        So the app can also be used to open e.g. text files, Word 6 files, RTF
                        files, as long as they're in the shared folder -- and Tom's symbolic
                        links discovery might obviate that requirement as well.

                        Thanks for noticing this.

                        John R.
                      • em315
                        Doesn t highlight here either, but works. Symbolic links: easy to create in OS X - I use them for all sorts of things. I forget which of a few different
                        Message 11 of 25 , Feb 13, 2010
                        • 0 Attachment
                          Doesn't highlight here either, but works.

                          Symbolic links: easy to create in OS X - I use them for all sorts of things. I forget which of a few different programs I use for this, but this one should work (and I think it's the one I may actually use)

                          http://seiryu.home.comcast.net/~seiryu/symboliclinker.html


                          --- In wordperfectmac@yahoogroups.com, jrethorst <no_reply@...> wrote:
                          >
                          >
                          >
                          > --- In wordperfectmac@yahoogroups.com, "em315" <em315@> wrote:
                          > >
                          > > Unless I'm misunderstanding something, the OS X app already is a droplet.
                          >
                          > Right you are! I'm having some kind of system issue so the app doesn't
                          > highlight when I drag a file over it. Nonetheless it opens the file, unless
                          > the file is not in the shared folder, in which case it says so.
                          >
                          > An alias of the app could be put on the desktop or the app can be
                          > added to the Dock for convenience.
                          >
                          > So the app can also be used to open e.g. text files, Word 6 files, RTF
                          > files, as long as they're in the shared folder -- and Tom's symbolic
                          > links discovery might obviate that requirement as well.
                          >
                          > Thanks for noticing this.
                          >
                          > John R.
                          >
                        • Smokey Ardisson
                          ... Are you on 10.4 like John? Or can someone tell me what types of files don t trigger a highlight? Smokey
                          Message 12 of 25 , Feb 14, 2010
                          • 0 Attachment
                            On Sat Feb 13, 2010 1:09 pm ((PST)), "em315" <em315@...> wrote:

                            >Doesn't highlight here either, but works.

                            Are you on 10.4 like John? Or can someone tell me what types of
                            files don't trigger a highlight?

                            Smokey
                          • em315
                            For some reason, highlighting started working (in other words, the droplet became highlighted when files were hovered over it - exactly what is supposed to
                            Message 13 of 25 , Feb 14, 2010
                            • 0 Attachment
                              For some reason, highlighting started working (in other words, the droplet became highlighted when files were hovered over it - exactly what is supposed to happen), but I don't know what I did to cause that. I did change "to run" to "on run", but highlighting still worked after I changed it back to "to run". I suspect that it started working after a reboot - perhaps OS X got its various internal databases sorted out?

                              I'm on 10.6.2, by the way.

                              --- In wordperfectmac@yahoogroups.com, Smokey Ardisson <smokey.ardisson@...> wrote:
                              >
                              > On Sat Feb 13, 2010 1:09 pm ((PST)), "em315" <em315@...> wrote:
                              >
                              > >Doesn't highlight here either, but works.
                              >
                              > Are you on 10.4 like John? Or can someone tell me what types of
                              > files don't trigger a highlight?
                              >
                              > Smokey
                              >
                            • em315
                              John, Here s a way to simplify this system even more. Use the new .sheepvm system that contains the disk image, preference file, and ROM inside the application
                              Message 14 of 25 , Feb 15, 2010
                              • 0 Attachment
                                John,

                                Here's a way to simplify this system even more. Use the new .sheepvm system that contains the disk image, preference file, and ROM inside the application itself, and put the whole .sheepvm package inside an Applescript, as I do with this:

                                http://dl.dropbox.com/u/271144/WPMacPPC%20Installer.dmg

                                Then, put all the code that is now in your separate droplet into the Applescript. That way, no separate droplet will be needed. You'll simply drop WP files onto the Sheepshaver package itself - just like any other application.

                                Because the file I link to up there requires 10.5 or later, you won't be able to run it, but the code should be easy to see, and it seems to work. It should be easy to strip out any 10.5-only code and still keep the basics. I think one would have to strip out the code that tests for other instances of SheepShaver running; that code probably isn't needed anyway but was there just to be triply safe.

                                The advantage of this setup is that it needs no installation. It simply runs, and can easily be modified with the code in your Open WP Files. This would make it possible to have a SheepShaver/WP setup that works almost exactly the way an ordinary application works.

                                What do you think?


                                --- In wordperfectmac@yahoogroups.com, jrethorst <no_reply@...> wrote:

                                >
                                > You're most welcome. Update free in the Files section, as Open WP Files 1.0.1.zip.
                                >
                                > John R.
                                >
                              • J Busch
                                I didn t have any problem with line breaks, but did have to delete a set of quotation marks near the end from the display dialog line I could not open...
                                Message 15 of 25 , Feb 15, 2010
                                • 0 Attachment
                                  I didn't have any problem with line breaks, but did have to delete a set of quotation marks near the end from the display dialog line "I could not open... This may be causing the error I now am experiencing, but haven't been able to flush it out just yet. About half the time the script works as expected. The other half when I close WP it waits a few seconds and then displays a dialog message that it can't open the file I just opened and then proceeds to open up WP with a blank document. I can close this instance of WP and SS will then shutdown as expected.

                                  Also if the document that WP is trying to open isn't compatible or causes WP to crash then SS hangs/freezes. I have only been able to force quit SS at this point. I am guessing that when WP crashes in one of the applescript loops that expects it to be running, it causes SS to hang.

                                  Thanks for the work on this
                                  Jonathan





                                  ________________________________
                                  From: em315 <em315@...>
                                  To: wordperfectmac@yahoogroups.com
                                  Sent: Sat, February 13, 2010 6:26:07 PM
                                  Subject: [wpmac] Re: [ANN] Open WP Files 1.0.1 - possible modification?




                                  John's terrific Open WP Files scripts make it possible to open WPMac/SheepShaver as if it were an OS X application that edits WordPerfect files. It occurred to me - would it be possible to modify the script so that SheepShaver closes down automatically when you quit WordPerfect, making it even more like a standard application?

                                  So I came up with this modified script, which might be named "~Open WP Files AutoShutDown" . This is designed to replace the script in the Startup Items folder of the System Folder in SheepShaver itself; John's existing "Open WP Files" OS X AppleScript does not need to be changed.

                                  To use this, I suggest removing all existing startup scripts from the Startup Items folder; restart SheepShaver. Launch this new script to see how it works. Make sure to test it before installing it in your Startup Items folder!

                                  You can now start up SheepShaver/ WP in two different ways. If you start up SheepShaver by double-clicking its desktop icon, it will start up and open WPMac with a blank document - just as if you were starting up WPMac on an old Mac. If, however, you start up SheepShaver by double-clicking a WP file in OS X, so that WPMac starts via John's "Open WP Files" Applescript, then WP will start with the document open, with no blank document window - exactly as it would start in an old Mac if you double-clicked on a WP file. When you quit WPMac, SheepShaver will also quit.

                                  Here's the code; it should be saved in SheepShaver' s Script Editor as an Application, with these options turned ON: Stay Open -and- Never Show Startup Screen. I'm not posting a compiled script just yet in case it causes problems that might be difficult for non-experts to deal with.

                                  ------------ ----
                                  -- Copyright © 2008-2010 by John Rethorst. All rights reserved. Free.
                                  --osax: Jon's Commands
                                  -- modified by Edward Mendelson for AutoShutDown
                                  -- also to suppress empty window when opening existing file

                                  global transferFolder
                                  global transferDoc
                                  global wpRunning
                                  global cycles
                                  property retSeconds : 2

                                  on run
                                  tell application "Finder"
                                  activate
                                  try
                                  set transferFolder to (folder "OSX > SS" of folder "SheepShaver Data" of folder "Unix") as alias
                                  on error
                                  try
                                  make folder at folder "Unix" with properties {name:"SheepShaver Data"}
                                  on error
                                  display dialog "Problem setting transfer folder."
                                  quit
                                  end try
                                  try
                                  make folder at folder "Unix:SheepShaver Data" with properties {name:"OSX > SS"}
                                  set transferFolder to result as alias
                                  on error
                                  end try
                                  end try

                                  try
                                  close window of folder "Unix:SheepShaver Data:OSX > SS"
                                  on error
                                  end try
                                  try
                                  close window of folder "Unix:SheepShaver Data"
                                  on error
                                  end try
                                  end tell
                                  set cycles to 1
                                  end run

                                  on idle
                                  try
                                  set doTransfer to true
                                  tell application "Finder" to set transferDoc to item 1 of transferFolder as alias
                                  on error
                                  set doTransfer to false
                                  --return 1
                                  end try

                                  if doTransfer is true then
                                  openDoc()
                                  else
                                  if cycles is 1 then
                                  tell application "WordPerfect" to activate
                                  set cycles to 2
                                  end if
                                  end if

                                  tell application "Finder"
                                  tell application "Finder" to name of processes
                                  if the result contains "WordPerfect" then
                                  set appRunning to true
                                  else
                                  set appRunning to false
                                  end if
                                  end tell

                                  if appRunning is false then
                                  if cycles is greater than 5 then
                                  -- tell me to quit -- use this for testing to avoid shutdown
                                  tell application "Finder" to shut down
                                  end if
                                  end if
                                  if cycles is less than 10 then
                                  set cycles to cycles + 1
                                  end if
                                  return retSeconds -- number of seconds between tests for application running
                                  end idle

                                  on openDoc()
                                  set tid to text item delimiters
                                  set text item delimiters to return

                                  set filePaths to (read transferDoc)
                                  set fileList to text items of filePaths

                                  tell application "WordPerfect"
                                  launch
                                  repeat with i from 1 to ((count items in fileList) - 1)
                                  try
                                  set thisFile to (item i of fileList as string)
                                  open (thisFile as alias)
                                  on error
                                  display dialog "I could not open "" & thisFile & ""." buttons ¬
                                  {"OK"} default button 1 with icon caution
                                  exit repeat
                                  end try
                                  end repeat
                                  end tell

                                  try
                                  deleteFile transferPath -- Jon's Commands
                                  on error
                                  tell application "Finder"
                                  if exists file transferDoc then
                                  delete transferDoc
                                  end if
                                  end tell
                                  end try
                                  set text item delimiters to tid
                                  end openDoc







                                  [Non-text portions of this message have been removed]
                                • em315
                                  I came across the same problem with the loops, and I think I fixed it. I haven t updated the version I posted here, but I created a new set called Launch WP
                                  Message 16 of 25 , Feb 15, 2010
                                  • 0 Attachment
                                    I came across the same problem with the loops, and I think I fixed it. I haven't updated the version I posted here, but I created a new set called Launch WP Files (and, for SheepShaver, ~Launch WP Files AutoShutdown. They're both in this zip file, and need to be used together so that they can recognize each other's files. (My version uses a hidden folder - hidden in OS X, anyway - to transfer data, not the visible one used in John's original.)

                                    http://dl.dropbox.com/u/271144/LaunchWPFiles.zip

                                    I've been testing them with BasiliskII, not SheepShaver, but they should work in SheepShaver; there's a variable at the top of the Launch WP Files script that tells it which to work with; it's set to SheepShaver in the version posted up there.

                                    --- In wordperfectmac@yahoogroups.com, J Busch <job4031@...> wrote:
                                    >
                                    > I didn't have any problem with line breaks, but did have to delete a set of quotation marks near the end from the display dialog line "I could not open... This may be causing the error I now am experiencing, but haven't been able to flush it out just yet. About half the time the script works as expected. The other half when I close WP it waits a few seconds and then displays a dialog message that it can't open the file I just opened and then proceeds to open up WP with a blank document. I can close this instance of WP and SS will then shutdown as expected.
                                    >
                                    > Also if the document that WP is trying to open isn't compatible or causes WP to crash then SS hangs/freezes. I have only been able to force quit SS at this point. I am guessing that when WP crashes in one of the applescript loops that expects it to be running, it causes SS to hang.
                                    >
                                    > Thanks for the work on this
                                    > Jonathan
                                    >
                                    >
                                    >
                                    >
                                    >
                                    > ________________________________
                                    > From: em315 <em315@...>
                                    > To: wordperfectmac@yahoogroups.com
                                    > Sent: Sat, February 13, 2010 6:26:07 PM
                                    > Subject: [wpmac] Re: [ANN] Open WP Files 1.0.1 - possible modification?
                                    >
                                    >
                                    >
                                    >
                                    > John's terrific Open WP Files scripts make it possible to open WPMac/SheepShaver as if it were an OS X application that edits WordPerfect files. It occurred to me - would it be possible to modify the script so that SheepShaver closes down automatically when you quit WordPerfect, making it even more like a standard application?
                                    >
                                    > So I came up with this modified script, which might be named "~Open WP Files AutoShutDown" . This is designed to replace the script in the Startup Items folder of the System Folder in SheepShaver itself; John's existing "Open WP Files" OS X AppleScript does not need to be changed.
                                    >
                                    > To use this, I suggest removing all existing startup scripts from the Startup Items folder; restart SheepShaver. Launch this new script to see how it works. Make sure to test it before installing it in your Startup Items folder!
                                    >
                                    > You can now start up SheepShaver/ WP in two different ways. If you start up SheepShaver by double-clicking its desktop icon, it will start up and open WPMac with a blank document - just as if you were starting up WPMac on an old Mac. If, however, you start up SheepShaver by double-clicking a WP file in OS X, so that WPMac starts via John's "Open WP Files" Applescript, then WP will start with the document open, with no blank document window - exactly as it would start in an old Mac if you double-clicked on a WP file. When you quit WPMac, SheepShaver will also quit.
                                    >
                                    > Here's the code; it should be saved in SheepShaver' s Script Editor as an Application, with these options turned ON: Stay Open -and- Never Show Startup Screen. I'm not posting a compiled script just yet in case it causes problems that might be difficult for non-experts to deal with.
                                    >
                                    > ------------ ----
                                    > -- Copyright © 2008-2010 by John Rethorst. All rights reserved. Free.
                                    > --osax: Jon's Commands
                                    > -- modified by Edward Mendelson for AutoShutDown
                                    > -- also to suppress empty window when opening existing file
                                    >
                                    > global transferFolder
                                    > global transferDoc
                                    > global wpRunning
                                    > global cycles
                                    > property retSeconds : 2
                                    >
                                    > on run
                                    > tell application "Finder"
                                    > activate
                                    > try
                                    > set transferFolder to (folder "OSX > SS" of folder "SheepShaver Data" of folder "Unix") as alias
                                    > on error
                                    > try
                                    > make folder at folder "Unix" with properties {name:"SheepShaver Data"}
                                    > on error
                                    > display dialog "Problem setting transfer folder."
                                    > quit
                                    > end try
                                    > try
                                    > make folder at folder "Unix:SheepShaver Data" with properties {name:"OSX > SS"}
                                    > set transferFolder to result as alias
                                    > on error
                                    > end try
                                    > end try
                                    >
                                    > try
                                    > close window of folder "Unix:SheepShaver Data:OSX > SS"
                                    > on error
                                    > end try
                                    > try
                                    > close window of folder "Unix:SheepShaver Data"
                                    > on error
                                    > end try
                                    > end tell
                                    > set cycles to 1
                                    > end run
                                    >
                                    > on idle
                                    > try
                                    > set doTransfer to true
                                    > tell application "Finder" to set transferDoc to item 1 of transferFolder as alias
                                    > on error
                                    > set doTransfer to false
                                    > --return 1
                                    > end try
                                    >
                                    > if doTransfer is true then
                                    > openDoc()
                                    > else
                                    > if cycles is 1 then
                                    > tell application "WordPerfect" to activate
                                    > set cycles to 2
                                    > end if
                                    > end if
                                    >
                                    > tell application "Finder"
                                    > tell application "Finder" to name of processes
                                    > if the result contains "WordPerfect" then
                                    > set appRunning to true
                                    > else
                                    > set appRunning to false
                                    > end if
                                    > end tell
                                    >
                                    > if appRunning is false then
                                    > if cycles is greater than 5 then
                                    > -- tell me to quit -- use this for testing to avoid shutdown
                                    > tell application "Finder" to shut down
                                    > end if
                                    > end if
                                    > if cycles is less than 10 then
                                    > set cycles to cycles + 1
                                    > end if
                                    > return retSeconds -- number of seconds between tests for application running
                                    > end idle
                                    >
                                    > on openDoc()
                                    > set tid to text item delimiters
                                    > set text item delimiters to return
                                    >
                                    > set filePaths to (read transferDoc)
                                    > set fileList to text items of filePaths
                                    >
                                    > tell application "WordPerfect"
                                    > launch
                                    > repeat with i from 1 to ((count items in fileList) - 1)
                                    > try
                                    > set thisFile to (item i of fileList as string)
                                    > open (thisFile as alias)
                                    > on error
                                    > display dialog "I could not open "" & thisFile & ""." buttons ¬
                                    > {"OK"} default button 1 with icon caution
                                    > exit repeat
                                    > end try
                                    > end repeat
                                    > end tell
                                    >
                                    > try
                                    > deleteFile transferPath -- Jon's Commands
                                    > on error
                                    > tell application "Finder"
                                    > if exists file transferDoc then
                                    > delete transferDoc
                                    > end if
                                    > end tell
                                    > end try
                                    > set text item delimiters to tid
                                    > end openDoc
                                    >
                                    >
                                    >
                                    >
                                    >
                                    >
                                    >
                                    > [Non-text portions of this message have been removed]
                                    >
                                  • J Busch
                                    This version has fixed the hang problem when WP doesn t open or crashes but now it doesn t open the file from OSX. It just displays a dialog saying it can t
                                    Message 17 of 25 , Feb 15, 2010
                                    • 0 Attachment
                                      This version has fixed the hang problem when WP doesn't open or crashes but now it doesn't open the file from OSX. It just displays a dialog saying it can't find the file. Then it opens a blank WP window, waits a few seconds before shutting down WP and then exits. If I just open SS without clicking on a WP file, I get WP to open with a blank doc window but then it too closes after a few seconds and then shuts down SS.

                                      I do like how you use hidden folders to pass the documents from OS X to SS and back and this does improve the OS X integration. And if you can package everything together that would be very nice, and help with the installation difficulties.

                                      I also isolated the previous scripts issue with not closing down to the difference in applescript of activate vs launch. It seems that you use launch so that the extra blank WP window won't open, but this seems to cause the exit problems in the original script. A downside that I noticed is that when you activate WP it takes a few more seconds to shutdown whereas launch shuts down instantly when it works.

                                      Hope this helps,
                                      Jonathan




                                      ________________________________
                                      From: em315 <em315@...>
                                      To: wordperfectmac@yahoogroups.com
                                      Sent: Mon, February 15, 2010 5:23:34 PM
                                      Subject: [wpmac] Re: [ANN] Open WP Files 1.0.1 - possible modification?


                                      I came across the same problem with the loops, and I think I fixed it. I haven't updated the version I posted here, but I created a new set called Launch WP Files (and, for SheepShaver, ~Launch WP Files AutoShutdown. They're both in this zip file, and need to be used together so that they can recognize each other's files. (My version uses a hidden folder - hidden in OS X, anyway - to transfer data, not the visible one used in John's original.)

                                      http://dl.dropbox com/u/271144/ LaunchWPFiles. zip

                                      I've been testing them with BasiliskII, not SheepShaver, but they should work in SheepShaver; there's a variable at the top of the Launch WP Files script that tells it which to work with; it's set to SheepShaver in the version posted up there.

                                      --- In wordperfectmac@ yahoogroups. com, J Busch <job4031@... > wrote:
                                      >
                                      > I didn't have any problem with line breaks, but did have to delete a set of quotation marks near the end from the display dialog line "I could not open... This may be causing the error I now am experiencing, but haven't been able to flush it out just yet. About half the time the script works as expected. The other half when I close WP it waits a few seconds and then displays a dialog message that it can't open the file I just opened and then proceeds to open up WP with a blank document. I can close this instance of WP and SS will then shutdown as expected.
                                      >
                                      > Also if the document that WP is trying to open isn't compatible or causes WP to crash then SS hangs/freezes. I have only been able to force quit SS at this point. I am guessing that when WP crashes in one of the applescript loops that expects it to be running, it causes SS to hang.
                                      >
                                      > Thanks for the work on this
                                      > Jonathan
                                      >
                                      >
                                      >
                                      >
                                      >
                                      > ____________ _________ _________ __
                                      > From: em315 <em315@...>
                                      > To: wordperfectmac@ yahoogroups. com
                                      > Sent: Sat, February 13, 2010 6:26:07 PM
                                      > Subject: [wpmac] Re: [ANN] Open WP Files 1.0.1 - possible modification?
                                      >
                                      >
                                      >
                                      >
                                      > John's terrific Open WP Files scripts make it possible to open WPMac/SheepShaver as if it were an OS X application that edits WordPerfect files. It occurred to me - would it be possible to modify the script so that SheepShaver closes down automatically when you quit WordPerfect, making it even more like a standard application?
                                      >
                                      > So I came up with this modified script, which might be named "~Open WP Files AutoShutDown" . This is designed to replace the script in the Startup Items folder of the System Folder in SheepShaver itself; John's existing "Open WP Files" OS X AppleScript does not need to be changed.
                                      >
                                      > To use this, I suggest removing all existing startup scripts from the Startup Items folder; restart SheepShaver. Launch this new script to see how it works. Make sure to test it before installing it in your Startup Items folder!
                                      >
                                      > You can now start up SheepShaver/ WP in two different ways. If you start up SheepShaver by double-clicking its desktop icon, it will start up and open WPMac with a blank document - just as if you were starting up WPMac on an old Mac. If, however, you start up SheepShaver by double-clicking a WP file in OS X, so that WPMac starts via John's "Open WP Files" Applescript, then WP will start with the document open, with no blank document window - exactly as it would start in an old Mac if you double-clicked on a WP file. When you quit WPMac, SheepShaver will also quit.
                                      >
                                      > Here's the code; it should be saved in SheepShaver' s Script Editor as an Application, with these options turned ON: Stay Open -and- Never Show Startup Screen. I'm not posting a compiled script just yet in case it causes problems that might be difficult for non-experts to deal with.
                                      >
                                      > ------------ ----
                                      > -- Copyright © 2008-2010 by John Rethorst. All rights reserved. Free.
                                      > --osax: Jon's Commands
                                      > -- modified by Edward Mendelson for AutoShutDown
                                      > -- also to suppress empty window when opening existing file
                                      >
                                      > global transferFolder
                                      > global transferDoc
                                      > global wpRunning
                                      > global cycles
                                      > property retSeconds : 2
                                      >
                                      > on run
                                      > tell application "Finder"
                                      > activate
                                      > try
                                      > set transferFolder to (folder "OSX > SS" of folder "SheepShaver Data" of folder "Unix") as alias
                                      > on error
                                      > try
                                      > make folder at folder "Unix" with properties {name:"SheepShaver Data"}
                                      > on error
                                      > display dialog "Problem setting transfer folder."
                                      > quit
                                      > end try
                                      > try
                                      > make folder at folder "Unix:SheepShaver Data" with properties {name:"OSX > SS"}
                                      > set transferFolder to result as alias
                                      > on error
                                      > end try
                                      > end try
                                      >
                                      > try
                                      > close window of folder "Unix:SheepShaver Data:OSX > SS"
                                      > on error
                                      > end try
                                      > try
                                      > close window of folder "Unix:SheepShaver Data"
                                      > on error
                                      > end try
                                      > end tell
                                      > set cycles to 1
                                      > end run
                                      >
                                      > on idle
                                      > try
                                      > set doTransfer to true
                                      > tell application "Finder" to set transferDoc to item 1 of transferFolder as alias
                                      > on error
                                      > set doTransfer to false
                                      > --return 1
                                      > end try
                                      >
                                      > if doTransfer is true then
                                      > openDoc()
                                      > else
                                      > if cycles is 1 then
                                      > tell application "WordPerfect" to activate
                                      > set cycles to 2
                                      > end if
                                      > end if
                                      >
                                      > tell application "Finder"
                                      > tell application "Finder" to name of processes
                                      > if the result contains "WordPerfect" then
                                      > set appRunning to true
                                      > else
                                      > set appRunning to false
                                      > end if
                                      > end tell
                                      >
                                      > if appRunning is false then
                                      > if cycles is greater than 5 then
                                      > -- tell me to quit -- use this for testing to avoid shutdown
                                      > tell application "Finder" to shut down
                                      > end if
                                      > end if
                                      > if cycles is less than 10 then
                                      > set cycles to cycles + 1
                                      > end if
                                      > return retSeconds -- number of seconds between tests for application running
                                      > end idle
                                      >
                                      > on openDoc()
                                      > set tid to text item delimiters
                                      > set text item delimiters to return
                                      >
                                      > set filePaths to (read transferDoc)
                                      > set fileList to text items of filePaths
                                      >
                                      > tell application "WordPerfect"
                                      > launch
                                      > repeat with i from 1 to ((count items in fileList) - 1)
                                      > try
                                      > set thisFile to (item i of fileList as string)
                                      > open (thisFile as alias)
                                      > on error
                                      > display dialog "I could not open "" & thisFile & ""." buttons ¬
                                      > {"OK"} default button 1 with icon caution
                                      > exit repeat
                                      > end try
                                      > end repeat
                                      > end tell
                                      >
                                      > try
                                      > deleteFile transferPath -- Jon's Commands
                                      > on error
                                      > tell application "Finder"
                                      > if exists file transferDoc then
                                      > delete transferDoc
                                      > end if
                                      > end tell
                                      > end try
                                      > set text item delimiters to tid
                                      > end openDoc
                                      >
                                      >
                                      >
                                      >
                                      >
                                      >
                                      >
                                      > [Non-text portions of this message have been removed]
                                      >







                                      [Non-text portions of this message have been removed]
                                    • em315
                                      Many thanks for the report. As I said, I ve been testing on Basilisk II, which is infinitely faster than SheepShaver on Intel Macs, and that may be causing the
                                      Message 18 of 25 , Feb 15, 2010
                                      • 0 Attachment
                                        Many thanks for the report. As I said, I've been testing on Basilisk II, which is infinitely faster than SheepShaver on Intel Macs, and that may be causing the quick shutdown problem you noticed. You might open the SheepShaver-based script in the Script Editor in SheepShaver and change the line that begins something like "if cycles is greater than" so that it uses a higher number (perhaps 8). Look around the script for other numbers that you can increase to take account of the slower performance. Remember that the first time you run the script, it may pause for a VERY long time, and then will ask you where "Corel WordPerfect" is - at that point, you should tell it where to find "WordPerfect".

                                        As for the script not finding the file, I fixed that - can't imagine how that went wrong. Thanks for the alert.

                                        Under SheepShaver, I get occasional looping problems that cause an apparent lockup in SheepShaver, and sometimes WP opens twice. I managed to fix these problems in BasiliskII, but probably the slower performance of SheepShaver is getting in the way. You may want to experiment.

                                        Meanwhile, the previous link now has the latest versions, including a SheepShaver-based one that doesn't automatically quit when you close WP. Link is still:

                                        http://dl.dropbox.com/u/271144/LaunchWPFiles.zip

                                        Interesting point about launch and activate. I wonder if it might be possible to tell WordPerfect first to launch and then to create a new file. John, or anyone else, what is the AppleScript command (if any) that tells WP to create a new, empty file?

                                        Except to fix serious bugs, I'm going to stop working on these, and go to work on modifying my SheepShaver-based no-installation-neededsystem so that it automatically opens WPMac files when you drop a file on its icon. That would produce a WordPerfect system that operated almost exactly like an OS X application - opens with a blank document when you click on it, opens an existing file when you click on a file or drop it on the application's icon.



                                        --- In wordperfectmac@yahoogroups.com, J Busch <job4031@...> wrote:
                                        >
                                        > This version has fixed the hang problem when WP doesn't open or crashes but now it doesn't open the file from OSX. It just displays a dialog saying it can't find the file. Then it opens a blank WP window, waits a few seconds before shutting down WP and then exits. If I just open SS without clicking on a WP file, I get WP to open with a blank doc window but then it too closes after a few seconds and then shuts down SS.
                                        >
                                        > I do like how you use hidden folders to pass the documents from OS X to SS and back and this does improve the OS X integration. And if you can package everything together that would be very nice, and help with the installation difficulties.
                                        >
                                        > I also isolated the previous scripts issue with not closing down to the difference in applescript of activate vs launch. It seems that you use launch so that the extra blank WP window won't open, but this seems to cause the exit problems in the original script. A downside that I noticed is that when you activate WP it takes a few more seconds to shutdown whereas launch shuts down instantly when it works.
                                        >
                                        > Hope this helps,
                                        > Jonathan
                                        >
                                        >
                                        >
                                        >
                                        > ________________________________
                                        > From: em315 <em315@...>
                                        > To: wordperfectmac@yahoogroups.com
                                        > Sent: Mon, February 15, 2010 5:23:34 PM
                                        > Subject: [wpmac] Re: [ANN] Open WP Files 1.0.1 - possible modification?
                                        >
                                        >
                                        > I came across the same problem with the loops, and I think I fixed it. I haven't updated the version I posted here, but I created a new set called Launch WP Files (and, for SheepShaver, ~Launch WP Files AutoShutdown. They're both in this zip file, and need to be used together so that they can recognize each other's files. (My version uses a hidden folder - hidden in OS X, anyway - to transfer data, not the visible one used in John's original.)
                                        >
                                        > http://dl.dropbox com/u/271144/ LaunchWPFiles. zip
                                        >
                                        > I've been testing them with BasiliskII, not SheepShaver, but they should work in SheepShaver; there's a variable at the top of the Launch WP Files script that tells it which to work with; it's set to SheepShaver in the version posted up there.
                                        >
                                        > --- In wordperfectmac@ yahoogroups. com, J Busch <job4031@ > wrote:
                                        > >
                                        > > I didn't have any problem with line breaks, but did have to delete a set of quotation marks near the end from the display dialog line "I could not open... This may be causing the error I now am experiencing, but haven't been able to flush it out just yet. About half the time the script works as expected. The other half when I close WP it waits a few seconds and then displays a dialog message that it can't open the file I just opened and then proceeds to open up WP with a blank document. I can close this instance of WP and SS will then shutdown as expected.
                                        > >
                                        > > Also if the document that WP is trying to open isn't compatible or causes WP to crash then SS hangs/freezes. I have only been able to force quit SS at this point. I am guessing that when WP crashes in one of the applescript loops that expects it to be running, it causes SS to hang.
                                        > >
                                        > > Thanks for the work on this
                                        > > Jonathan
                                        > >
                                        > >
                                        > >
                                        > >
                                        > >
                                        > > ____________ _________ _________ __
                                        > > From: em315 <em315@>
                                        > > To: wordperfectmac@ yahoogroups. com
                                        > > Sent: Sat, February 13, 2010 6:26:07 PM
                                        > > Subject: [wpmac] Re: [ANN] Open WP Files 1.0.1 - possible modification?
                                        > >
                                        > >
                                        > >
                                        > >
                                        > > John's terrific Open WP Files scripts make it possible to open WPMac/SheepShaver as if it were an OS X application that edits WordPerfect files. It occurred to me - would it be possible to modify the script so that SheepShaver closes down automatically when you quit WordPerfect, making it even more like a standard application?
                                        > >
                                        > > So I came up with this modified script, which might be named "~Open WP Files AutoShutDown" . This is designed to replace the script in the Startup Items folder of the System Folder in SheepShaver itself; John's existing "Open WP Files" OS X AppleScript does not need to be changed.
                                        > >
                                        > > To use this, I suggest removing all existing startup scripts from the Startup Items folder; restart SheepShaver. Launch this new script to see how it works. Make sure to test it before installing it in your Startup Items folder!
                                        > >
                                        > > You can now start up SheepShaver/ WP in two different ways. If you start up SheepShaver by double-clicking its desktop icon, it will start up and open WPMac with a blank document - just as if you were starting up WPMac on an old Mac. If, however, you start up SheepShaver by double-clicking a WP file in OS X, so that WPMac starts via John's "Open WP Files" Applescript, then WP will start with the document open, with no blank document window - exactly as it would start in an old Mac if you double-clicked on a WP file. When you quit WPMac, SheepShaver will also quit.
                                        > >
                                        > > Here's the code; it should be saved in SheepShaver' s Script Editor as an Application, with these options turned ON: Stay Open -and- Never Show Startup Screen. I'm not posting a compiled script just yet in case it causes problems that might be difficult for non-experts to deal with.
                                        > >
                                        > > ------------ ----
                                        > > -- Copyright © 2008-2010 by John Rethorst. All rights reserved. Free.
                                        > > --osax: Jon's Commands
                                        > > -- modified by Edward Mendelson for AutoShutDown
                                        > > -- also to suppress empty window when opening existing file
                                        > >
                                        > > global transferFolder
                                        > > global transferDoc
                                        > > global wpRunning
                                        > > global cycles
                                        > > property retSeconds : 2
                                        > >
                                        > > on run
                                        > > tell application "Finder"
                                        > > activate
                                        > > try
                                        > > set transferFolder to (folder "OSX > SS" of folder "SheepShaver Data" of folder "Unix") as alias
                                        > > on error
                                        > > try
                                        > > make folder at folder "Unix" with properties {name:"SheepShaver Data"}
                                        > > on error
                                        > > display dialog "Problem setting transfer folder."
                                        > > quit
                                        > > end try
                                        > > try
                                        > > make folder at folder "Unix:SheepShaver Data" with properties {name:"OSX > SS"}
                                        > > set transferFolder to result as alias
                                        > > on error
                                        > > end try
                                        > > end try
                                        > >
                                        > > try
                                        > > close window of folder "Unix:SheepShaver Data:OSX > SS"
                                        > > on error
                                        > > end try
                                        > > try
                                        > > close window of folder "Unix:SheepShaver Data"
                                        > > on error
                                        > > end try
                                        > > end tell
                                        > > set cycles to 1
                                        > > end run
                                        > >
                                        > > on idle
                                        > > try
                                        > > set doTransfer to true
                                        > > tell application "Finder" to set transferDoc to item 1 of transferFolder as alias
                                        > > on error
                                        > > set doTransfer to false
                                        > > --return 1
                                        > > end try
                                        > >
                                        > > if doTransfer is true then
                                        > > openDoc()
                                        > > else
                                        > > if cycles is 1 then
                                        > > tell application "WordPerfect" to activate
                                        > > set cycles to 2
                                        > > end if
                                        > > end if
                                        > >
                                        > > tell application "Finder"
                                        > > tell application "Finder" to name of processes
                                        > > if the result contains "WordPerfect" then
                                        > > set appRunning to true
                                        > > else
                                        > > set appRunning to false
                                        > > end if
                                        > > end tell
                                        > >
                                        > > if appRunning is false then
                                        > > if cycles is greater than 5 then
                                        > > -- tell me to quit -- use this for testing to avoid shutdown
                                        > > tell application "Finder" to shut down
                                        > > end if
                                        > > end if
                                        > > if cycles is less than 10 then
                                        > > set cycles to cycles + 1
                                        > > end if
                                        > > return retSeconds -- number of seconds between tests for application running
                                        > > end idle
                                        > >
                                        > > on openDoc()
                                        > > set tid to text item delimiters
                                        > > set text item delimiters to return
                                        > >
                                        > > set filePaths to (read transferDoc)
                                        > > set fileList to text items of filePaths
                                        > >
                                        > > tell application "WordPerfect"
                                        > > launch
                                        > > repeat with i from 1 to ((count items in fileList) - 1)
                                        > > try
                                        > > set thisFile to (item i of fileList as string)
                                        > > open (thisFile as alias)
                                        > > on error
                                        > > display dialog "I could not open "" & thisFile & ""." buttons ¬
                                        > > {"OK"} default button 1 with icon caution
                                        > > exit repeat
                                        > > end try
                                        > > end repeat
                                        > > end tell
                                        > >
                                        > > try
                                        > > deleteFile transferPath -- Jon's Commands
                                        > > on error
                                        > > tell application "Finder"
                                        > > if exists file transferDoc then
                                        > > delete transferDoc
                                        > > end if
                                        > > end tell
                                        > > end try
                                        > > set text item delimiters to tid
                                        > > end openDoc
                                        > >
                                        > >
                                        > >
                                        > >
                                        > >
                                        > >
                                        > >
                                        > > [Non-text portions of this message have been removed]
                                        > >
                                        >
                                        >
                                        >
                                        >
                                        >
                                        >
                                        >
                                        > [Non-text portions of this message have been removed]
                                        >
                                      • jrethorst
                                        ... tell WordPerfect first to launch and then to create a new file. John, or anyone else, what is the AppleScript command (if any) that tells WP to create a
                                        Message 19 of 25 , Feb 15, 2010
                                        • 0 Attachment
                                          --- In wordperfectmac@yahoogroups.com, "em315" <em315@...> wrote:

                                          > Interesting point about launch and activate. I wonder if it might be possible to
                                          tell WordPerfect first to launch and then to create a new file. John, or anyone
                                          else, what is the AppleScript command (if any) that tells WP to create a new,
                                          empty file?

                                          make window

                                          or, with text:

                                          set theText to "the rain in Spain"
                                          tell app "WordPerfect" to make window with data "" & theText

                                          BTW, the launch command doesn't run an OnStartup macro if any.
                                          Solution:

                                          tell app "WordPerfect"
                                          launch
                                          do script "OnStartup"
                                          end tell

                                          WP does not return an error if there's no such macro, so no need
                                          for a try block.

                                          You know, I'm hesitant about the auto shutdown when the user quits WP.
                                          There are occasions when I want to quit WP but keep SS running, even
                                          though I don't use SS for anything else. For example, every month or three
                                          it's a good idea to quit WP, go to System Folder > Preferences > WordPerfect
                                          and make a backup of the Library and Preferences files. WP should not
                                          be running when you copy the Library; the copy is unusable otherwise.

                                          This is great work though, and I really like the invisible transfer folder.
                                          It's also a great idea to put the disk image, rom file etc. in the app
                                          bundle. Just yesterday, working on this, I managed to open the disk
                                          image in OSX while SS was running. Corrupted it, of course.

                                          John R.
                                        • jrethorst
                                          ... Is just the app itself faster, or is WP also faster? John R.
                                          Message 20 of 25 , Feb 15, 2010
                                          • 0 Attachment
                                            --- In wordperfectmac@yahoogroups.com, "em315" <em315@...> wrote:
                                            >
                                            > I've been testing on Basilisk II, which is infinitely faster than SheepShaver on Intel Macs,

                                            Is just the app itself faster, or is WP also faster?

                                            John R.
                                          • em315
                                            The BasiliskII app launches and loads the desktop in about two seconds. On my setup, SheepShaver takes at least five times as long - even with 7.5.5 in both
                                            Message 21 of 25 , Feb 15, 2010
                                            • 0 Attachment
                                              The BasiliskII app launches and loads the desktop in about two seconds. On my setup, SheepShaver takes at least five times as long - even with 7.5.5 in both systems (with 7.5.5 correctly installed for 68K in BII and for PPC in SS).

                                              As for WP's speed, could you possibly cobble together a macro that I could run to test speed? Perhaps one that creates a new file, types some text into it, then copies and pastes that text X times (X = a hundred or more), and then searches and replaces a string in the text and then closes the file under a specific name on the desktop? That would be a useful tool for comparing speeds on different platforms.

                                              I agree with you about reasons not to use autoshutdown. I either Alt-Tab to the script and Quit it, or sometimes just pull it out of the Startup Items folder and restart. By uncommenting one line and commenting out another, you can make the script shut itself down instead of shutting down the system.


                                              --- In wordperfectmac@yahoogroups.com, jrethorst <no_reply@...> wrote:
                                              >
                                              > --- In wordperfectmac@yahoogroups.com, "em315" <em315@> wrote:
                                              > >
                                              > > I've been testing on Basilisk II, which is infinitely faster than SheepShaver on Intel Macs,
                                              >
                                              > Is just the app itself faster, or is WP also faster?
                                              >
                                              > John R.
                                              >
                                            • jrethorst
                                              ... Following is a macro that has WP type the lyrics to the song 99 Bottles of Beer on the Wall (done as an entry for a site that has scripts for this in
                                              Message 22 of 25 , Feb 15, 2010
                                              • 0 Attachment
                                                --- In wordperfectmac@yahoogroups.com, "em315" <em315@...> wrote:

                                                > As for WP's speed, could you possibly cobble together a macro that I could run to test speed? Perhaps one that creates a new file, types some text into it, then copies and pastes that text X times (X = a hundred or more), and then searches and replaces a string in the text and then closes the file under a specific name on the desktop? That would be a useful tool for comparing speeds on different platforms.

                                                Following is a macro that has WP type the lyrics to the song "99 Bottles of Beer
                                                on the Wall" (done as an entry for a site that has scripts for this in 1317
                                                programming languages -- link in the Links section here). The macro script
                                                has a last line added, closing the window for purposes of the speed test.
                                                Following that is an Applescript that runs the macro and times it. WP should
                                                have no windows open when you run this. The "Do Script" line in the
                                                Applescript can be duplicated any number of times for a longer, thus
                                                more accurate, test.

                                                When I first did the SS/WP install, I timed WP on it and on my 2004 G4 PPC
                                                iMac by spell-checking a 48,000 word document with footnotes. It took 16
                                                seconds on the PPC and 20 on a 2006 Intel Macbook core duo (not core
                                                duo 2). Curiously, WP types the 99 Bottles lyrics in 15 seconds on the PPC
                                                and 12 on the Intel, running the Applescript from Script Editor.

                                                John R.

                                                ===========

                                                WP macro:

                                                New Document
                                                Assign (Var01;99)
                                                Repeat
                                                Type Var (Var01)
                                                ;
                                                If (Var01=1)
                                                Type ( bottle of beer on the wall, )
                                                Else
                                                Type ( bottles of beer on the wall, )
                                                End If
                                                ;
                                                Type Var (Var01)
                                                If (Var01=1)
                                                Type ( bottle of beer,)
                                                Else
                                                Type ( bottles of beer,)
                                                End If
                                                Hard Return
                                                ;
                                                Type (Take one down and pass it around, )
                                                Assign (Var01;Var01-1)
                                                ;
                                                If (Var01!=0)
                                                Type Var (Var01)
                                                Else
                                                Type (No)
                                                End If
                                                ;
                                                If (Var01=1)
                                                Type ( bottle of beer on the wall.)
                                                Else
                                                Type ( bottles of beer on the wall.)
                                                End If
                                                Hard Return
                                                Hard Return
                                                Until (Var01=0)
                                                ;
                                                Type (No more bottles of beer on the wall, )
                                                Type (No more bottles of beer,)
                                                Hard Return
                                                Type (Go to the store and buy some more, )
                                                Type (99 bottles of beer on the wall.)
                                                ;
                                                Beep
                                                ; Alert ("Buy more beer!"); this line commented out for speed test
                                                ;
                                                Close; this line added for speed test

                                                =================

                                                Applescript:

                                                set time1 to time of (current date)
                                                tell application "WordPerfect"
                                                activate
                                                Do Script "99 bottles"
                                                end tell

                                                repeat
                                                tell application "WordPerfect" to set windowCount to (count windows)
                                                if windowCount < 1 then
                                                exit repeat
                                                end if
                                                delay 1
                                                end repeat
                                                set time2 to time of (current date)

                                                tell me
                                                activate
                                                display dialog "You drank 99 bottles of beer in " & ((time2 - time1) as string) & " seconds."
                                                end tell
                                              • jrethorst
                                                ... I tried it and did not see a difference. It runs smoothly either way here. The order in the original script is based on the idea of opening the file in WP
                                                Message 23 of 25 , Feb 16, 2010
                                                • 0 Attachment
                                                  > --- In wordperfectmac@yahoogroups.com, "em315" <em315@> wrote:

                                                  > I was having a lot of trouble making the Open WP Files work reliably in Sheepshaver and Basilisk II - I kept getting lockups in the emulator - until I figured out what seems to be the solution:

                                                  > In the Sheepshaver-based script, move the block of lines that deletes the transferData so that it appears above the lines that open the files, and not after. Once you've read the data, you no longer need the file, and everything seems to happen a lot more smoothly this way.

                                                  I tried it and did not see a difference. It runs smoothly either way here. The
                                                  order in the original script is based on the idea of opening the file in WP as
                                                  soon as possible, then doing cleanup. It's moot here, since Jon's Commands'
                                                  DeleteFile is very fast, so I'll switch the order. I don't know why the lockups
                                                  would occur. I'll try it using the Akua Sweets' osax delete file command just
                                                  for fun.

                                                  BTW I added these lines to the SS Startup script:

                                                  tell app "WordPerfect"
                                                  launch
                                                  do script "OnStartup"
                                                  end tell

                                                  This runs what can be a very helpful macro, that I use mainly to restore
                                                  default settings that I might have changed in the last session. It also
                                                  starts WP but without a blank window. The user can choose New Document
                                                  or open an existing file without the then unwanted new doc.

                                                  John R.
                                                • em315
                                                  It turns out that the same problems recurred in my setup. It seems to be a problem with using 7.5.5; the timing just doesn t come out right. Incidentally, I
                                                  Message 24 of 25 , Feb 16, 2010
                                                  • 0 Attachment
                                                    It turns out that the same problems recurred in my setup. It seems to be a problem with using 7.5.5; the timing just doesn't come out right.

                                                    Incidentally, I found a curious problem in Sheepshaver/7.5.5, described here. It seems more or less to rule out my plan for using that combination regularly:

                                                    http://www.emaculation.com/forum/viewtopic.php?t=6180

                                                    Over to you for future development, John!

                                                    --- In wordperfectmac@yahoogroups.com, jrethorst <no_reply@...> wrote:

                                                    > I tried it and did not see a difference. It runs smoothly either way here. The
                                                    > order in the original script is based on the idea of opening the file in WP as
                                                    > soon as possible, then doing cleanup. It's moot here, since Jon's Commands'
                                                    > DeleteFile is very fast, so I'll switch the order. I don't know why the lockups
                                                    > would occur. I'll try it using the Akua Sweets' osax delete file command just
                                                    > for fun.
                                                    >
                                                  • em315
                                                    John and Smokey and anyone else who knows Applescript Is there a way for Open WP Files (or similar code) to handle filenames longer than 31 characters? A WP
                                                    Message 25 of 25 , Feb 19, 2010
                                                    • 0 Attachment
                                                      John and Smokey and anyone else who knows Applescript

                                                      Is there a way for Open WP Files (or similar code) to handle filenames longer than 31 characters? A WP might have a longer name thanks to being renamed in OS X, but it won't open in SheepShaver.

                                                      I noticed this when trying to open the WP document that serves as a readme for the WP Spotlight by Gero Hermann:

                                                      http://homepage.mac.com/herr/

                                                      There's a WP-format readme file on the disk images, but the name is too long for it to get moved into SheepShaver via these macros.

                                                      Is there an obvious solution that I haven't figured out?
                                                    Your message has been successfully submitted and would be delivered to recipients shortly.