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

7527Re: WPMac macro question

Expand Messages
  • em315
    Nov 20, 2012
      I've now got a PDF-writing macro working in a primitive sort of way. What it does is this:

      In WPMac, the macro creates a file named OpenPDF.file in the folder that contains a folder action script, and then prints the current document by writing a print file to that same folder (as in the printing system that we both use).

      On the OS X side, when the folder action script detects the print file, it checks for the existence of the OpenPDF.file file, and, if it finds it, deletes it, and then converts the print file from PS to PDF and opens the resulting file in Preview. If the folder action script doesn't find that file, it prints the print file to the default printer.

      The next thing to do is to write a similar macro that will create a file named WritePDF.file; this will signal the folder action script to write a PDF file to the desktop (or some other folder?) with the same name as the WP document. That will be a bit more complicated.

      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?


      --- In wordperfectmac@yahoogroups.com, "em315" <em315@...> wrote:
      >
      > I was afraid of that. Would it be possible for a PDF-writing macro to do the following:
      >
      > 1. Write a file to the same folder to which the print file will be written; the file will be named something like MakePDF.
      >
      > 2. Then write the print file to the same folder.
      >
      > Meanwhile, on the OS X side, the folder action script will see that a MakePDF file has been written, and will wait (say) one minute for a .PS file to be written to the same folder. If a .PS file does get written in that period, the folder action script will delete the MakePDF file and convert the .PS file to a PDF file, with the same name as the name part of the .PS file. If the name of the .PS file begins with "untitled" (or whatever WP uses), then the PDF file will get an arbitrary filename based on the current date and time.
      >
      > Does this sound plausible? This is somewhat similar to the way the PDF-writing macro works in the system I've devised for using WPDOS under OS X.
      >
      > --- In wordperfectmac@yahoogroups.com, "John R" <johnrethorst@> wrote:
      > >
      > > I don't see how a WP Mac macro could do this. A folder action script could change the name of a file that lands in the folder, but would need a basis for the decision whether to change the name.
      > >
      > > John R.
      > >
      > >
      > >
      > > --- In wordperfectmac@yahoogroups.com, "em315" <em315@> wrote:
      > > >
      > > > This is a question for John and any other expert:
      > > >
      > > > Is it possible for a macro to do the following:
      > > >
      > > > If printing to a virtual printer (a "printer" that creates a PostScript file), when the Save dialog opens, change the name of the output file so that (for example) the name filename.ps is changed to something like filename-pdf.ps.
      > > >
      > > > The point of this is to modify the filename so that, when the file is saved to a folder in OS X, a folder action script attached to that folder can recognize the "-pdf.ps" in the name, and automatically create a PDF file.
      > > >
      > > > This can't be recorded. Is it possible to write such a macro?
      > > >
      > >
      >
    • Show all 15 messages in this topic