Posted to tcl by apn at Wed Feb 09 12:54:50 GMT 2022view raw
- proc zipnmail {dir urls} {
- set downloads [all [lmap url $urls {
- [pgeturl $url] then [lambda {dir url http_state} {
- save_file $dir $url [dict get $http_state body]
- } $dir $url]
- }]]
- set zip [$downloads then [lambda {dir dontcare} {
- then_chain [pexec zip -r pages.zip $dir]
- } $dir]]
- set email [$zip then [lambda dontcare {
- then_chain [pexec blat pages.zip -to someone@somewhere.com]
- }]]
- $email done [lambda {dontcare} {
- tk_messageBox -message "Zipped and sent!"
- }]
- }