Paste most recently downloaded file Macro - attach in gmail (v11.0.3)

Attach most recently downloaded file Macro (v11.0.3)

Hi! I couldn't find anything that did exactly this, so I created the macro here. If someone's already shared something like it, sorry for duplicating!

This macro finds the most recently modified file in the downloads folder, copies the file reference, and pastes it (shoutout to chatgpt for help with the scripting). If you use it in a gmail draft, it will attach the file unless it's an image, which it inserts in-line.

P.S. If anyone knows how to get gmail to add an image file as an attachment with KB, let me know.

Attach most recently downloaded file.kmmacros (2.8 KB)