7694Re: Can a macro modify an existing macro?
- Mar 4, 2013The 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.
--- In firstname.lastname@example.org, "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.
- << Previous post in topic Next post in topic >>