Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

AppleScript crashing MailMate

#301

Hi Benny,

I tried to adapt one of the example Applescripts today to make it work with GrandTotal. However, it always crashes MailMate. I am outputting the mailto: line to check it looks alright and it does. I'm not quite sure if it is my fault or if there is a bug in MailMate.

I have attached the Applescript and I would be pleased as punch if you could take a quick look at it.

Reported by Alexander Kucera · November 16th, 2012 @ 10:54 AM

State: new
Milestone: none
Assigned to: benny benny

Activity

  1. Alexander Kucera
    Alexander Kucera

    For reference, a typical string as I send it to MailMate:

    mailto:john%2Ekueble%40image%2Ede?subject=IMAGE%20GmbH%20%2F%2F%20Lidl%20Interactive%20Spot%20%D1%20Rechnung%20121116%2D0082&body=Lieber%20Herr%20K%9Fble%2C%0D%0Danbei%20unsere%20Rechnung%20f%9Fr%20den%20Lidl%20Interactive%20Spot%20Film%2E%0D%0DWir%20hoffen%20das%20Projekt%20entsprach%20Ihren%20Vorstellungen%2E%0D%0DViele%20Gr%9F%A7e%2C%0D%0D&attachment-url=file://%2Fvar%2Ffolders%2Fkr%2Fyd3vlvrs3%5F9df4hflddfrpb40000gp%2FT%2F121116%2D0082%2Epdf

    November 16th, 2012 @ 10:58 AM

  2. benny
    benny

    I'm not an expert in AppleScript, but the problem seems to be encoding related. All text given to the script should be UTF-8 and that does not seem to be the case. Do you know the encoding of the provided text?

    Here is an example of me asking MailMate to create a message with the subject 'æøå' (Danish letters):

    osascript -e 'tell application "MailMate" to open location "mailto:mm-feedback@freron.com?subject=%C3%A6%C3%B8%C3%A5"'
    

    But MailMate should not crash! Do you have an example that crashes (the above didn't). I'll review the code. (Looking at the crash reports that problem seems to be related to attachments.)

    November 16th, 2012 @ 11:22 AM

  3. benny
    benny

    I've reproduced the crash bug and I'll fix that part of the problem.

    November 16th, 2012 @ 07:37 PM

  4. Alexander Kucera
    Alexander Kucera

    Hi Benny,

    sorry for being slow to respond. Lots on my plate recently. Is the crash related to the attachment or something else? I ask, because I need the attachment to work for this. I am using this script to send my invoices from GrandTotal to MailMate instead of Mail.app. And that obviously requires me to attach said invoice. :)

    I'll try and fix the UTF-8 issue on my end.

    November 21st, 2012 @ 09:54 AM

  5. benny
    benny
    • State changed from new to reproduced

    I believe it is a general bug related to attachments, so you probably cannot make it work before I fix that bug. But I have a few other issues I have to fix first (this one is driving me mad) :-)

    November 21st, 2012 @ 10:07 AM

  6. Alexander Kucera
    Alexander Kucera

    No worries. I found a workaround that works for now.

    tell application "Finder"
       reveal the_file
       activate
    end tell
    

    Not as elegant as directly attaching a file, but opening its locations and then a quick drag & drop will do for now. :)

    Also, I when I leave off the attachment, my code seems to work fine. No UTF-8 issues even with more complex characters.

    November 21st, 2012 @ 10:46 AM

  7. benny
    benny
    • State changed from reproduced to fixcommitted

    November 23rd, 2012 @ 03:54 PM

  8. Alexander Kucera
    Alexander Kucera

    Cheers Benny! I'm looking forward to trying it out.

    November 23rd, 2012 @ 05:30 PM

  9. benny
    benny
    • State changed from fixcommitted to fixreleased

    December 13th, 2012 @ 02:22 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.