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

7531Re: WPMac macro question

Expand Messages
  • em315
    Nov 21, 2012
    • 0 Attachment
      The IF... statement was what I needed. Thank you. After adding it to the macro I was already using, I got this:

      If (NumberOfWindows>0)
      New Document
      Type (a)
      Save As ("WPMac HD:System Folder:WPMacAppData:OpenPDF.file")
      Close
      Print Options (1;32000;1;Document;Every Page;Forward;Print Overlay)
      Print (Document)
      Else
      Alert ("No document window open.")
      End If

      Sometime over the next few days, I'll try to add an opening menu ("Create a PDF file and open it in Preview?") and work on the OS X folder action script to refine it a bit. My guess is that you could do this far more elegantly than I ever will!

      --- In wordperfectmac@yahoogroups.com, "John R" <johnrethorst@...> wrote:
      >
      > --- In wordperfectmac@yahoogroups.com, "John R" <johnrethorst@> wrote:
      > >
      > > --- In wordperfectmac@yahoogroups.com, "em315" <em315@> wrote:
      > >
      > > > Macro question: what is the IF THEN statement that checks whether a window is open in WPMac, so that a PDF-writing macro will refuse to run if there is no document open to "print" to PDF?
      > >
      > > Any window, or a window of a given name?
      >
      >
      > To check for any open window in WP:
      >
      > If (NumberOfWindows<1)
      > ; no windows open
      > End If
      >
      >
      > To check for a window of a given name:
      >
      > On Error (error)
      > Select Window ("OpenPDF")
      > Alert ("You got it")
      > Go (further)
      > Label (error)
      > Alert ("No such window as OpenPDF")
      > Return
      > ;
      > Label (further)
      > Alert ("Macro continues here")
      >
    • Show all 15 messages in this topic