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

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

Expand Messages
  • 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 1 of 9 , Aug 9, 2012
      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.