quicksilver / Quicksilver

Quicksilver Project Source
http://qsapp.com
Apache License 2.0
2.74k stars 286 forks source link

Apple Mail Module 3.0.0: signature no longer inserted into Composed messages #1073

Closed genegoykhman closed 2 years ago

genegoykhman commented 12 years ago

In older versions of this plug-in, using the Apple Mail "Compose E-mail" action would open a new mail message with my default signature already inserted into the body of the message. After upgrading to B69 (64-bit) and Apple Mail Module 3.0.0, new messages are opened completely blank. It would be nice to restore the signature insertion if possible.

jasonnmark commented 11 years ago

Agreed, would be nice...

skurfer commented 11 years ago

It uses AppleScript and the script hasn't changed as far as I know. Could this have changed with an OS update? Can you get it to work outside Quicksilver using AppleScript alone?

jasonnmark commented 11 years ago

Nope... it's an issue with applescript as well as Quicksilver and Filemaker. It broke in Lion, was working fine in Snow Leopard.

skurfer commented 11 years ago

Yeah, I just ran Quicksilver in 32-bit mode with the old version of the plug-in and it does the same thing. Looked at the AppleScript dictionary for Mail and there are some things you can do with signatures, like

set message signature of theMessage to item 0 of signatures

But figuring out which is the right signature in various situations is beyond my AppleScript abilities (or interests).

jasonnmark commented 11 years ago

I would opt to use "Default" since it's name-based. If that doesn't work another option would to set it to a sig named "Quicksilver". that way if there isn't one it will still be blank but people CAN set one if they want. I prefer default... but that's just me...

jasonnmark commented 11 years ago

PS: this set message signature tip was awesome. I just used it for my Filemaker solution and it makes that all pretty too... :)

skurfer commented 11 years ago

I would opt to use "Default" since it's name-based.

I don't have one named "Default" and I have different defaults for work and personal accounts, so it's not that easy. I tried to list signatures by account, but it apparently only list all of them together.

jasonnmark commented 11 years ago

Bummer... well maybe if there's one named "Quicksilver" use that? Just thinking outloud.

jasonnmark commented 11 years ago

Here's the right way to do it:

    try
        set message signature of theMessage to item 0 of signatures
    end try
skurfer commented 11 years ago

I tried that initially, but it has no awareness of which account you're sending from, so for example, all of your work messages would end up with your personal signature on them.

jasonnmark commented 11 years ago

Gurr... So what do you think about using something like Default or Quicksilver? Wouldn't work for everyone but would at least provide some workaround until Apple fixes it for real?

skurfer commented 11 years ago

Sounds like a decent compromise for the time being. But I'm afraid getting it done is nowhere near the top of the list. :-)

jasonnmark commented 11 years ago

What if I tossed some money to "the fund", or can I have one of my dev's fix it and submit it? I don't see the module in github but maybe I'm not recognizing the name of the plugin. :)

skurfer commented 11 years ago

I have money. I need time and motivation. :-)

The plug-in source is at https://github.com/quicksilver/com.apple.Mail-qsplugin

Pull requests welcome. Although, now that I think about it, the Mail plug-in has no preferences. There are some in the Mail Support plug-in, but those prefs aren't (and shouldn't be) application specific. So that complicates things quite a bit, but there is at least some basic documentation.

jasonnmark commented 11 years ago

Cool... that's what I need! You rock... :)

pjrobertson commented 11 years ago

Hi @jasonnmark,

I'm the opposite of @skurfer at the moment; I have time and motivation but I'm low on the funds ;-) Are you getting one of your devs to look into this, or would you like me to do it? I could probably get it sorted and another release out by the end of the weekend.

If you want to firm up any details, then just send me a private message/email at patrick@qsapp.com

genegoykhman commented 11 years ago

I've just taken a shot at implementing this enhancement. In the AppleMailElement.xcodeproj, there is a file Mail.scpt that contains the AppleScripts used by the plug-in. One of the methods within the script, create_mail, is responsible for new mail composition. I've put up a modified create_mail here:

https://gist.github.com/4514089

This modified create_mail scans through all the signatures in Mail and selects the first one named either "Default" or "Quicksilver" and uses that for the outgoing message.

@skurfer, if you agree with this approach and would merge a pull request, let me know and I can put one together. @jasonmark, feel free to build your own version of the plug-in as I have and modify the script as you require. The toughest part is just getting the build environment set up.

skurfer commented 11 years ago

My last reply makes no sense in this context because I had a conversation from IRC in mind. :-)

@pjrobertson and I decided the best approach is to add a preference that would let you pick one of your existing Mail signatures to use as the default for all accounts.

pjrobertson commented 2 years ago

Unfortunately Apple has restricted the use of Apple Mail for 'security' reasons. As such, we've had to disable the Apple Mail plugin. If Apple ever allow access to the Mail settings in the future, we can revisit this.