Hi again, I just read this article about pinning apps to your finder toolbar http://www.wired.com/gadgetlab/2013/10/finder-toolbar-app-shortcut/ and, having just gotten into applescript, tried pinning a script. IT WORKED! It’s in the toolbar right now. This is cool, right? It got me thinking…
What I want to do?
I’d really like to pin a script that takes any file dragged onto it and turns that into an email attachment of a new email (with a set subject, list of recipient emails (co-workers) and some stock text (maybe pop up a dialog for adding any extra necessary text (meetings, birthdays, etc) to the body of the email in version 2.0 of the script). It should be really useful for the weekly roster mailout for work.
What’s my problem?
I’m pretty sure I can handle the script for all of that (mail scripts seem especially well represented on the forums which helps) except the very start - I’ve only ever written folder action scripts and automator services so I have no idea how to tell a script “if I drag a file onto you, do this to it”.
I hate to be picky but…
There are a couple of workarounds that even I can see: simply creating a template draft in mail and just pinning mail.app to the finder toolbar would get me most of the way there; a folder action watching for a filename containing “Roster” would probably do it with what I already know (though I usually version from the previous weeks roster so I have a template for the one I’m doing, so I would have to change my creating/saving routine or a folder-add action would send out the wrong week’s roster).
I sort of want to learn how to do it the way I describe above though, partly because I’m stupid stubborn and partly because it seems like a useful trick I could learn to use for other scripts down the line. I have this other idea with… no. One idea/post/thread at a time
Thanks for having a look a my question, and thanks in advance for any suggestions (I can guess it’s not the most complex and stimulating of problems for experienced applescripters)
nec