Posted to tcl by apn at Wed Feb 09 12:54:50 GMT 2022view raw

  1. proc zipnmail {dir urls} {
  2. set downloads [all [lmap url $urls {
  3. [pgeturl $url] then [lambda {dir url http_state} {
  4. save_file $dir $url [dict get $http_state body]
  5. } $dir $url]
  6. }]]
  7. set zip [$downloads then [lambda {dir dontcare} {
  8. then_chain [pexec zip -r pages.zip $dir]
  9. } $dir]]
  10. set email [$zip then [lambda dontcare {
  11. then_chain [pexec blat pages.zip -to someone@somewhere.com]
  12. }]]
  13. $email done [lambda {dontcare} {
  14. tk_messageBox -message "Zipped and sent!"
  15. }]
  16. }