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

Re: [wpmac] Can a macro modify an existing macro?

Expand Messages
  • Daryl Chinn
    Ed and all, I don t think we can create this modifiable macro. I created a macro that magnifies the (entire) text of a document by doing this: Open the Layout
    Message 1 of 6 , Mar 4, 2013
    • 0 Attachment
      Ed and all,

      I don't think we can create this modifiable macro. I created a macro that
      magnifies the (entire) text of a document by doing this:

      Open the Layout Bar (the one that shows formatting, columns, create tables, and
      magnification, super- or sub-script, etc.)

      1. Under Tools, click on Macro / Record...
      2. A window appears: Choose a Name for your macro (mine is called Bigger);
      fill in a description if you wish; then click Assign.
      3. Type a key combination. WP will a) show you what keys you've chosen, and it
      will also b)show if the key combination is already used. For instance, if you
      type Control-B, WP will say that Control-B is for Bold-facing. In my case, I
      chose Command-Option-B.
      4. Choose a magnification. You must do this—at this time, if you try to create
      a macro that leads you to the dialogue box for magnification percentage, the
      Layout line goes gray and you can't choose anything else at all. What I mean is
      that you can't stop the macro recording at this point with the dialogue box
      still open. (I chose 150%; you can choose anything you wish.)
      5. After you choose a magnification, go back to Tools / Macro and click "Stop
      recording."

      Henceforth, when you type the key combination, your entire screen will show the
      text in that magnification. If you want to change it, you can go to the Layout
      bar, go to the Magnification, and choose whatever else you want. Or you can go
      the Show Codes, find the magnification, and delete it, and then the document
      will go to your default magnification.

      You could modify your magnification setting by going to Tools / Macro / Edit. A
      window will appear that says something like, Macro:Bigger[or whatever you named
      it]. Here you can change the number/percentage magnification. Save and close.

      Sorry that I could not create a variable macro. Perhaps some other
      script—Applescript?? I don't think you can do this in the Preferences (where
      you can choose to show / hide bars upon opening WP), but perhaps there's
      someplace else where one could get a customized default opening magnification.
      I may even dream up something in my sleep. At one point, I recall that you
      could tell Macs to open things other than the OS when you started up. I think
      you can still do this, but not with the Macro Ed suggests.

      Daryl Chinn
      Poet, Teacher, Editor
    • John R
      The short answer is no -- WP macros can t access any part of the Library, including macros. But: A macro can set a global variable, which could then be
      Message 2 of 6 , Mar 4, 2013
      • 0 Attachment
        The short answer is no -- WP macros can't access any part of the Library, including macros. But:

        A macro can set a global variable, which could then be accessed by any other macro within that session of WP.

        A macro could open a document stuck away in, say, Preferences > WordPerfect, that has only the number 120 in it, read and then close that document, and use the number for magnification, in OnOpenDocument or anywhere.

        An Applescript could use Prefab Player to edit a Library macro.

        A macro can contain the line:
        Execute Apple Script ("name of script") [note: name only, not path. WP finds it.]
        which could put the number on the clipboard for the macro's use.

        Or an Applescript could get a default number when first run, and on subsequent runs pass it to a macro.

        John R.


        --- In wordperfectmac@yahoogroups.com, "em315" <em315@...> wrote:
        >
        > Here's another WP macro question: Can a macro modify another macro?
        >
        > I would like to create a macro that would let the user set a default zoom setting for WPMac. The macro would prompt for the desired zoom percentage; if the user enters "120", then the macro would modify a line an existing "OnOpenDocument" macro so that a line in it would read "Magnification(120)" instead of whatever number was there before.
        >
        > I don't think this is possible, but if anyone knows how to accomplish such a thing, he or she probably visits this forum.
        >
      • em315
        These are very ingenious ideas. Thank you. By combining them, it should be possible to set a default zoom level for WP with minimal effort by the user. Will
        Message 3 of 6 , Mar 5, 2013
        • 0 Attachment
          These are very ingenious ideas. Thank you. By combining them, it should be possible to set a default zoom level for WP with minimal effort by the user. Will experiment with it.

          --- In wordperfectmac@yahoogroups.com, "John R" <johnrethorst@...> wrote:
          >
          > A macro could open a document stuck away in, say, Preferences > WordPerfect, that has only the number 120 in it, read and then close that document, and use the number for magnification, in OnOpenDocument or anywhere.
          >
          > A macro can contain the line:
          > Execute Apple Script ("name of script") [note: name only, not path. WP finds it.]
          > which could put the number on the clipboard for the macro's use.
        • darylngee
          Ed and all, I don t think we can create this modifiable macro. I created a macro that magnifies the (entire) text of a document by doing this: Open the Layout
          Message 4 of 6 , Mar 5, 2013
          • 0 Attachment
            Ed and all,

            I don't think we can create this modifiable macro. I created a macro that magnifies the (entire) text of a document by doing this:

            Open the Layout Bar (the one that shows formatting, columns, create tables, and magnification, super- or sub-script, etc.)

            1. Under Tools, click on Macro / Record...
            2. A window appears: Choose a Name for your macro (mine is called Bigger); fill in a description if you wish; then click Assign.
            3. Type a key combination. WP will a) show you what keys you've chosen, and it will also b)show if the key combination is already used. For instance, if you type Control-B, WP will say that Control-B is for Bold-facing. In my case, I chose Command-Option-B.
            4. Choose a magnification. You must do this—at this time, if you try to create a macro that leads you to the dialogue box for magnification percentage, the Layout line goes gray and you can't choose anything else at all. What I mean is that you can't stop the macro recording at this point with the dialogue box still open. (I chose 150%; you can choose anything you wish.)
            5. After you choose a magnification, go back to Tools / Macro and click "Stop recording."

            Henceforth, when you type the key combination, your entire screen will show the text in that magnification. If you want to change it, you can go to the Layout bar, go to the Magnification, and choose whatever else you want. Or you can go the Show Codes, find the magnification, and delete it, and then the document will go to your default magnification. Or you could create a macro for another magnification greater than or less than the first one.

            You could modify your current magnification setting by going to Tools / Macro / Edit. A window will appear that says something like, Macro:Bigger[or whatever you named it]. Here you can change the number/percentage magnification. Save and close.

            Sorry that I could not create a variable macro. Perhaps some other script—Applescript?? I don't think you can do this in the Preferences (where you can choose to show / hide bars upon opening WP), but perhaps there's someplace else where one could get a customized default opening magnification. I may even dream up something in my sleep. At one point, I recall that you could tell Macs to open things other than the OS when you started up. I think you can still do this, but not with the Macro Ed suggests.

            Daryl Chinn
            Poet, Teacher, Editor


            --- In wordperfectmac@yahoogroups.com, "em315" <em315@...> wrote:
            >
            > These are very ingenious ideas. Thank you. By combining them, it should be possible to set a default zoom level for WP with minimal effort by the user. Will experiment with it.
            >
            > --- In wordperfectmac@yahoogroups.com, "John R" <johnrethorst@> wrote:
            > >
            > > A macro could open a document stuck away in, say, Preferences > WordPerfect, that has only the number 120 in it, read and then close that document, and use the number for magnification, in OnOpenDocument or anywhere.
            > >
            > > A macro can contain the line:
            > > Execute Apple Script ("name of script") [note: name only, not path. WP finds it.]
            > > which could put the number on the clipboard for the macro's use.
            >
          • em315
            Daryl, That s excellent detailed advice. It s possible to create a magnification macro even more easily: simply create a macro with the line
            Message 5 of 6 , Mar 6, 2013
            • 0 Attachment
              Daryl,

              That's excellent detailed advice. It's possible to create a magnification macro even more easily: simply create a macro with the line "Magnification(120.0)" (without the quotation marks), using whatever magnification you prefer. That can be the default in all documents, new and existing, by performing two steps:

              1. Include the line "Magnification(120.0)" or whatever number you prefer in a macro called OnOpenDocument. This will apply the magnification to existing documents when opened.

              2. Create an empty file named New Document Template in the Templates folder. The existence of this file will cause the OnOpenDocument macro to apply the magnification to new documents also.

              John has suggested a way to read the 120.0 (or whatever number) from a file, so that a user can run a macro or Applescript that creates that file, and WP can then read the file to determine which magnification to use.

              I've got this working, but it conflicts with John's routines for closing any existing empty windows when opening a document and I haven't figured out how to make the two co-exist.

              --- In wordperfectmac@yahoogroups.com, "darylngee" <darylngee@...> wrote:
              >
              > Ed and all,
              >
              > I don't think we can create this modifiable macro. I created a macro that magnifies the (entire) text of a document by doing this:
              >
              > Open the Layout Bar (the one that shows formatting, columns, create tables, and magnification, super- or sub-script, etc.)
              >
              > 1. Under Tools, click on Macro / Record...
              > 2. A window appears: Choose a Name for your macro (mine is called Bigger); fill in a description if you wish; then click Assign.
              > 3. Type a key combination. WP will a) show you what keys you've chosen, and it will also b)show if the key combination is already used. For instance, if you type Control-B, WP will say that Control-B is for Bold-facing. In my case, I chose Command-Option-B.
              > 4. Choose a magnification. You must do this—at this time, if you try to create a macro that leads you to the dialogue box for magnification percentage, the Layout line goes gray and you can't choose anything else at all. What I mean is that you can't stop the macro recording at this point with the dialogue box still open. (I chose 150%; you can choose anything you wish.)
              > 5. After you choose a magnification, go back to Tools / Macro and click "Stop recording."
              >
              > Henceforth, when you type the key combination, your entire screen will show the text in that magnification. If you want to change it, you can go to the Layout bar, go to the Magnification, and choose whatever else you want. Or you can go the Show Codes, find the magnification, and delete it, and then the document will go to your default magnification. Or you could create a macro for another magnification greater than or less than the first one.
              >
              > You could modify your current magnification setting by going to Tools / Macro / Edit. A window will appear that says something like, Macro:Bigger[or whatever you named it]. Here you can change the number/percentage magnification. Save and close.
              >
              > Sorry that I could not create a variable macro. Perhaps some other script—Applescript?? I don't think you can do this in the Preferences (where you can choose to show / hide bars upon opening WP), but perhaps there's someplace else where one could get a customized default opening magnification. I may even dream up something in my sleep. At one point, I recall that you could tell Macs to open things other than the OS when you started up. I think you can still do this, but not with the Macro Ed suggests.
              >
              > Daryl Chinn
              > Poet, Teacher, Editor
              >
              >
              > --- In wordperfectmac@yahoogroups.com, "em315" <em315@> wrote:
              > >
              > > These are very ingenious ideas. Thank you. By combining them, it should be possible to set a default zoom level for WP with minimal effort by the user. Will experiment with it.
              > >
              > > --- In wordperfectmac@yahoogroups.com, "John R" <johnrethorst@> wrote:
              > > >
              > > > A macro could open a document stuck away in, say, Preferences > WordPerfect, that has only the number 120 in it, read and then close that document, and use the number for magnification, in OnOpenDocument or anywhere.
              > > >
              > > > A macro can contain the line:
              > > > Execute Apple Script ("name of script") [note: name only, not path. WP finds it.]
              > > > which could put the number on the clipboard for the macro's use.
              > >
              >
            Your message has been successfully submitted and would be delivered to recipients shortly.