On Wed, Dec 20, 2000 at 12:16:58PM +0100, Heinrich Langos wrote:

> could mutt ask me for input while running a macro ?
> like this:
> i press my remind-key and mutt askes me for input (e.g. the time i
> want to be reminded of that message) and then pipes the mail to an
> external programm putting the input that i gave it in the X-Label
> header or on the command line for my external programm?

> so the question that remains is: how do i prompt a user in mutt
> for input and use that input in the macro?

Here's one way.

    macro index <Esc>r <pipe-message>remind_script<Return>
    macro pager <Esc>r <pipe-message>remind_script<Return>

where remind_script is something like this:

    echo "Enter time for reminder:"
    read time < /dev/tty
    subject=$(sed -n '/^Subject: /s/^[^:]*: //p')
    echo "mutt -s \"Reminder: $subject\"" your_address | at $time

Note that 'mutt' is executed at the time specified and in the
environment of 'at' and therefore the message body is no longer
available (besides being consumed by 'sed' in this example).  I'm sure
that's solvable, too, but I'll leave that to you.

Gary

-- 
Gary Johnson                 | Agilent Technologies
[EMAIL PROTECTED]     | RF Communications Product Generation Unit
                             | Spokane, Washington, USA

Reply via email to