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

Re: [wpmac] Re: A simple, free, low-tech WP file viewer for OS X

Expand Messages
  • Geoff Gilbert
    Stunning! Thank you -- Geoff Gilbert Professor of Law Editor-in-Chief, International Journal of Refugee Law Head of the School of Law School of Law and Human
    Message 1 of 9 , Aug 9, 2012
    • 0 Attachment
      Stunning! Thank you
      --
      Geoff Gilbert
      Professor of Law
      Editor-in-Chief, International Journal of Refugee Law
      Head of the School of Law
      School of Law and Human Rights Centre
      University of Essex
      Wivenhoe Park
      Colchester
      CO4 3SQ

      Tel: +44 (0)1206 872557
      Fax: +44 (0)1206 873428
      Email: geoff (for those outside the University, add @ followed by
      essex.ac.uk)



      > em315 <mailto:em315@...>
      > 9 August 2012 13:06
      > The current version is slightly revised again, with slightly improved
      > logic. Also, when the text of the WP file is displayed in TextEdit,
      > the underlying file is an RTF file, not an HTML file (though it looks
      > exactly the same). This seems to be more useful for anyone who wants
      > to save the converted file directly from TextEdit rather than simply
      > copying the text to some other application.
      >
      > The conversion of the WP file to HTML and then RTF takes a fraction of
      > a second longer than the conversion to HTML only. If you prefer the
      > faster performance, open the WP Viewer application in the AppleScript
      > Editor, find the line near the top that says "property make RTF : 1"
      > and change 1 to 0. This is documented in the file. (Mountain Lion
      > users should run the AppleScript once before making this change, so
      > that OS X will not mistakenly think that someone has maliciously
      > modified the file before it got to you.)
      >
      >
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      > .
      >
      > Chad Smith <mailto:chad78@...>
      > 8 August 2012 16:44
      > Thank you for this!
      >
      > *- Chad W. Smith*
      >
      >
      >
      >
      >
      > [Non-text portions of this message have been removed]
      >
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      > .
      >


      [Non-text portions of this message have been removed]
    • Smokey Ardisson
      ... FWIW, a better way to handle that would be to read an NSUserDefault for that instead of having people modify the app directly (it would also withstand
      Message 2 of 9 , Aug 9, 2012
      • 0 Attachment
        On Thu Aug 9, 2012 5:06 am ((PDT)), "em315" <em315@...> wrote:

        > If you prefer the faster performance, open the WP Viewer
        >application in the AppleScript Editor, find the line near the top
        >that says "property make RTF : 1" and change 1 to 0. This is
        >documented in the file.

        FWIW, a "better" way to handle that would be to read an NSUserDefault
        for that instead of having people modify the app directly (it would
        also withstand app upgrades). It's slightly more cumbersome for the
        user (having to 'defaults write org.wpdos.wpviewer makeRTF -bool
        false' rather than editing a property) and a bit more code on your
        end, but cleaner overall.

        Since you appear to only be targeting Intel Macs, I think you can use
        the property list suite (introduced in 10.4 iirc) to do the reading
        as pure AppleScript, but "do shell script 'defaults read
        org.wpdos.wpviewer makeRTF'" will work, too (bools are stored
        internally as 1 and 0 and not converted by 'defaults read', so the
        output of defaults read is exactly what you'd want if you go that
        way).

        Smokey
      • em315
        I ve had in the back of my mind to figure out how to do something like that. I ll try to implement it over the next few days. Thank you. Another method I ve
        Message 3 of 9 , Aug 9, 2012
        • 0 Attachment
          I've had in the back of my mind to figure out how to do something like that. I'll try to implement it over the next few days. Thank you.

          Another method I've used in other AppleScripts apps for changing default behavior is to check the name of the application. For example, my AppleScript wrapper for WordPrefect for DOS under DOSBox checks whether its name is"WPDOSBox51" or "WPDOSBox62" and launches the correct version of WPDOS (5.1 or 6.2 - the user has to supply the executables themselves) depending on its name.

          --- In wordperfectmac@yahoogroups.com, Smokey Ardisson <smokey.ardisson@...> wrote:
          >
          > On Thu Aug 9, 2012 5:06 am ((PDT)), "em315" <em315@...> wrote:
          >
          > > If you prefer the faster performance, open the WP Viewer
          > >application in the AppleScript Editor, find the line near the top
          > >that says "property make RTF : 1" and change 1 to 0. This is
          > >documented in the file.
          >
          > FWIW, a "better" way to handle that would be to read an NSUserDefault
          > for that instead of having people modify the app directly (it would
          > also withstand app upgrades). It's slightly more cumbersome for the
          > user (having to 'defaults write org.wpdos.wpviewer makeRTF -bool
          > false' rather than editing a property) and a bit more code on your
          > end, but cleaner overall.
          >
          > Since you appear to only be targeting Intel Macs, I think you can use
          > the property list suite (introduced in 10.4 iirc) to do the reading
          > as pure AppleScript, but "do shell script 'defaults read
          > org.wpdos.wpviewer makeRTF'" will work, too (bools are stored
          > internally as 1 and 0 and not converted by 'defaults read', so the
          > output of defaults read is exactly what you'd want if you go that
          > way).
          >
          > Smokey
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.