Re: Saving all attachments

2015-06-09 Thread Michael Tatge
* On Tue, Jun 09, 2015 04:33PM -0400 Xu Wang (xuwang...@gmail.com) muttered:
> On Tue, Jun 9, 2015 at 4:00 PM, Marcelo Laia  wrote:
> > On 09/06/15 at 02:23pm, Michael Tatge wrote:
> >> # extract all attachments
> >> macro index,pager X ' set my_wk=$wait_key; unset
> >> wait_key\
> >>  ripmime --paranoid -i - -d ~/tmp/attachments\
> >>  set wait_key=$my_wk' "save all attachments"
> >>
> >> macro attach X ' set my_wk=$wait_key; unset 
> >> wait_key\
> >>  ripmime --paranoid -i - -d ~/tmp/attachments\
> >>  set wait_key=$my_wk\
> >> ' "save all attachments"
> >>
> > What is the difference between these two macros?
> 
> difference is just that you can use the second macro in the attach
> menu. The reason it is different is that it needs to exit, the attach
> menu (back to pager menu?), then do the real work, then go back to
> attach menu.

I wrote that macro with the index as the starting point in mind. But you
describe it perfectly. :)
Drop that  btw. That was a leftover from testing.

> I actually wonder if the two macros could share some more code. That
> is, can the attach macro call the first macro?

One, if I'm not mistaken - the only way, to call a macro within a macro
is to push it's key sequence. The downside here is that you need two
different keys then. Besides I find it harder to read and debug.
 
So you could try something like:
macro index,pager ,X ...
macro attach X ' push ,X'

HTH,

Michael
-- 
PGP-Key-ID: EEE7D043
Jabber: in...@jabber.de


Re: Saving all attachments

2015-06-09 Thread Xu Wang
On Tue, Jun 9, 2015 at 4:00 PM, Marcelo Laia  wrote:
> On 09/06/15 at 02:23pm, Michael Tatge wrote:
>> FWIW,
>>
>> I ended up with these two macros:
>>
>> # extract all attachments
>> macro index,pager X ' set my_wk=$wait_key; unset
>> wait_key\
>>  ripmime --paranoid -i - -d ~/tmp/attachments\
>>  set wait_key=$my_wk' "save all attachments"
>>
>> macro attach X ' set my_wk=$wait_key; unset 
>> wait_key\
>>  ripmime --paranoid -i - -d ~/tmp/attachments\
>>  set wait_key=$my_wk\
>> ' "save all attachments"
>>
>
>
> Hi,
>
> What is the difference between these two macros?

Hello Marcelo, from my naive understanding (so I could be wrong), the
difference is just that you can use the second macro in the attach
menu. The reason it is different is that it needs to exit, the attach
menu (back to pager menu?), then do the real work, then go back to
attach menu.

I actually wonder if the two macros could share some more code. That
is, can the attach macro call the first macro?

Kind regards,

Xu


Re: Saving all attachments

2015-06-09 Thread Marcelo Laia
On 09/06/15 at 02:23pm, Michael Tatge wrote:
> FWIW,
> 
> I ended up with these two macros:
> 
> # extract all attachments
> macro index,pager X ' set my_wk=$wait_key; unset
> wait_key\
>  ripmime --paranoid -i - -d ~/tmp/attachments\
>  set wait_key=$my_wk' "save all attachments"
>  
> macro attach X ' set my_wk=$wait_key; unset 
> wait_key\
>  ripmime --paranoid -i - -d ~/tmp/attachments\
>  set wait_key=$my_wk\
> ' "save all attachments"
> 


Hi,

What is the difference between these two macros?


-- 
Marcelo


Re: Saving all attachments

2015-06-09 Thread Chris Spackman
On 2015/06/09 at 01:42pm, Michael Tatge wrote:

> * On Sun, Jun 07, 2015 02:44PM -0400 Chris Spackman
>   (ch...@osugisakae.com) muttered:
> >macro index,pager X "ripmime -i - -d "
> > but you have to "press any key to continue" after it finishes
>
> that depends - see $wait_key.

Ha, wonderful mutt, I should have know there would be a variable for
this. Thanks!

> For instance you could use a macro like:
>
> # extract all attachments
> macro index X ' set my_wk=$wait_key; unset wait_key\
>  ripmime --paranoid -i - -d ~/attachments\
>  set wait_key=$my_wk' "save all attachements"

> Which resets $wait_key to whatever it was before, after it's done.
> Also note that commands starting with a blank " ripime..." don't
> clutter the history.

Awesome, thank you for this.

-- 
Chris Spackman

GNU Terry Pratchett



Re: Saving all attachments

2015-06-09 Thread Michael Tatge
FWIW,

I ended up with these two macros:

# extract all attachments
macro index,pager X ' set my_wk=$wait_key; unset
wait_key\
 ripmime --paranoid -i - -d ~/tmp/attachments\
 set wait_key=$my_wk' "save all attachments"
 
macro attach X ' set my_wk=$wait_key; unset 
wait_key\
 ripmime --paranoid -i - -d ~/tmp/attachments\
 set wait_key=$my_wk\
' "save all attachments"

Michael
-- 
PGP-Key-ID: EEE7D043
Jabber: in...@jabber.de


Re: Saving all attachments

2015-06-09 Thread Michael Tatge
Chris,

* On Sun, Jun 07, 2015 02:44PM -0400 Chris Spackman (ch...@osugisakae.com) 
muttered:
>macro index,pager X "ripmime -i - -d "
> 
> but you have to "press any key to continue" after it finishes

that depends - see $wait_key.

For instance you could use a macro like:

# extract all attachments
macro index X ' set my_wk=$wait_key; unset wait_key\
 ripmime --paranoid -i - -d ~/attachments\
 set wait_key=$my_wk' "save all attachements"

Which resets $wait_key to whatever it was before, after it's done.
Also note that commands starting with a blank " ripime..." don't clutter
the history. 

HTH,

Michael
-- 
PGP-Key-ID: EEE7D043
Jabber: in...@jabber.de


Re: Saving all attachments

2015-06-08 Thread Marcelo Laia
So good!

https://packages.debian.org/unstable/main/ripmime

2015-06-08 9:29 GMT-03:00 Chris Spackman :
> On 2015/06/08 at 12:03am, Xu Wang wrote:
>> On Sun, Jun 7, 2015 at 3:28 PM, John Niendorf  wrote:
>> > On Sun, Jun 07, 2015 at 02:44:22PM -0400, Chris Spackman wrote:
>>
>> >> This seems to be the "official" site for ripmime:
>> >> http://www.pldaniels.com/ripmime/
>> >> --
>> >> Chris Spackman
>>
>> > Hey thanks Chris,
>> >
>> > This is really handy!  I wish I'd known about it earlier.
>> > --
>> > John
>>
>> This is a very good tool to know. It seems as if it were created
>> exactly for this purpose. Thank you for the tip!
>> Xu
>
> Glad it is helpful. I cannot recall for sure, but I might have heard
> of it on this list. But it was at least a couple of years ago. I put
> the command into .muttrc and haven't read the manual or had to do
> anything other that press X since then. Very handy tool.
>
> --
> Chris Spackman
>
> GNU Terry Pratchett
>



-- 
Laia, M. L.


Re: Saving all attachments

2015-06-08 Thread Chris Spackman
On 2015/06/08 at 12:03am, Xu Wang wrote:
> On Sun, Jun 7, 2015 at 3:28 PM, John Niendorf  wrote:
> > On Sun, Jun 07, 2015 at 02:44:22PM -0400, Chris Spackman wrote:
>
> >> This seems to be the "official" site for ripmime:
> >> http://www.pldaniels.com/ripmime/
> >> --
> >> Chris Spackman
>
> > Hey thanks Chris,
> >
> > This is really handy!  I wish I'd known about it earlier.
> > --
> > John
>
> This is a very good tool to know. It seems as if it were created
> exactly for this purpose. Thank you for the tip! 
> Xu

Glad it is helpful. I cannot recall for sure, but I might have heard
of it on this list. But it was at least a couple of years ago. I put
the command into .muttrc and haven't read the manual or had to do
anything other that press X since then. Very handy tool.

-- 
Chris Spackman

GNU Terry Pratchett



Re: Saving all attachments

2015-06-07 Thread Xu Wang
On Sun, Jun 7, 2015 at 3:28 PM, John Niendorf  wrote:
> On Sun, Jun 07, 2015 at 02:44:22PM -0400, Chris Spackman wrote:
>>
>> I have this in my .muttrc:
>>
>>   macro index,pager X "ripmime -i - -d "
>>
>> when I press X, ripmime asks for a directory and then puts all the
>> attachments there. No need to select any attachments or confirm the
>> saving (but you have to "press any key to continue" after it
>> finishes).
>>
>> This seems to be the "official" site for ripmime:
>> http://www.pldaniels.com/ripmime/
>>
>> --
>> Chris Spackman
>
>
> Hey thanks Chris,
>
> This is really handy!  I wish I'd known about it earlier.
> --
> John

This is a very good tool to know. It seems as if it were created
exactly for this purpose. Thank you for the tip!

Kind regards,

Xu


Re: Saving all attachments

2015-06-07 Thread John Niendorf

On Sun, Jun 07, 2015 at 02:44:22PM -0400, Chris Spackman wrote:

I have this in my .muttrc:

  macro index,pager X "ripmime -i - -d "

when I press X, ripmime asks for a directory and then puts all the
attachments there. No need to select any attachments or confirm the
saving (but you have to "press any key to continue" after it
finishes).

This seems to be the "official" site for ripmime:
http://www.pldaniels.com/ripmime/

--
Chris Spackman


Hey thanks Chris,

This is really handy!  I wish I'd known about it earlier.
--
John


Re: Saving all attachments

2015-06-07 Thread Chris Spackman
On 2015/05/31 at 08:25am, Xu Wang wrote:
> When doing the following, as suggested by [1],
> 
> /home/xuwang/Downloads/
> 
> I am presented with "File is a directory, save under it? [(y)es, (n)o, (a)ll]"
> 
> Is there an option to choose this value in an rc variable? I cannot
> seem to find it?
> I would like to have the automatic response "yes".

Hello, this is a little different from what you are asking but it has
the same result with less work. Have you tried ripmime? It is software
designed to work with mutt and it can automatically save all
attachments to a folder with minimal work.

I have this in my .muttrc:

   macro index,pager X "ripmime -i - -d "

when I press X, ripmime asks for a directory and then puts all the
attachments there. No need to select any attachments or confirm the
saving (but you have to "press any key to continue" after it
finishes).

This seems to be the "official" site for ripmime:
http://www.pldaniels.com/ripmime/

-- 
Chris Spackman

GNU Terry Pratchett



Re: Saving all attachments

2002-04-10 Thread Cameron Simpson

On 12:56 10 Apr 2002, David Champion <[EMAIL PROTECTED]> wrote:
| * On 2002.04.10, in <[EMAIL PROTECTED]>,
| * "Andre Bonhote" <[EMAIL PROTECTED]> wrote:
| > I recently received a mail with about 20 attached files. The sender
| > didn't want to tar it, so I got them attached one by one.
| > You can imagine that saving was quite annoying.
| > Is there a way to save all at once?
| 
| No, but tagging all 20 messages, pressing 
| (probably ";s"), and pressing enter 20 times should be less painless.

Pipe the message through munpack:

|munpack

or

|mkdir unpack-dir;cd unpack-dir; munpack

should do it just fine. That's what I use for any procmail based automatic
unpacking I use  - well, with a wrapper script:

http://www.zip.com.au/~cs/scripts/mailunpack

Cheers,
-- 
Cameron Simpson, DoD#743[EMAIL PROTECTED]http://www.zip.com.au/~cs/

One rider (Kenny Roberts?) described The CorkScrew as:
It's like driving your bike into a phone booth, and then
having the phone booth dropped down an elevator shaft!



Re: Saving all attachments

2002-04-10 Thread David Champion

* On 2002.04.10, in <[EMAIL PROTECTED]>,
*   "David Champion" <[EMAIL PROTECTED]> wrote:
> 
> No, but tagging all 20 messages, pressing 
> (probably ";s"), and pressing enter 20 times should be less painless.

s/nless/nful/

-- 
 -D.[EMAIL PROTECTED]NSITUniversity of Chicago



Re: Saving all attachments

2002-04-10 Thread David Champion

* On 2002.04.10, in <[EMAIL PROTECTED]>,
*   "Andre Bonhote" <[EMAIL PROTECTED]> wrote:
> Hi there, mutt users!
> 
> I recently received a mail with about 20 attached files. The sender
> didn't want to tar it, so I got them attached one by one.
> 
> You can imagine that saving was quite annoying.
> 
> Is there a way to save all at once?

No, but tagging all 20 messages, pressing 
(probably ";s"), and pressing enter 20 times should be less painless.

-- 
 -D.[EMAIL PROTECTED]NSITUniversity of Chicago



Re: Saving all attachments

2002-04-10 Thread Shawn McMahon

begin  Andre Bonhote quotation:
> 
> I recently received a mail with about 20 attached files. The sender
> didn't want to tar it, so I got them attached one by one.

IMHO, bounce it, and say "give me a break, dude, use tar."


-- 
Shawn McMahon| Information may want to be free, but fiber
http://www.eiv.com   | optic cable wants to be one million US
AIM: spmcmahonfedex, smcmahoneiv | dollars per mile.



msg26989/pgp0.pgp
Description: PGP signature