1

I'm developing a custom dictionary add-on to add to Mac's Dictionary.app.

I would want my user to report dictionary add-on's errors or his/her comments (if any) to me as the developer. So far, I have been using the following AppleScript to send such reports to me using Mail.app.

tell application "Finder"
set current_path to (container of (path to me) as string) & "VT_icon.icns"
end tell

display dialog "Intro. to Dict Add-on." with title "My Dictionary for Mac" with icon file current_path buttons {"Cancel", "OK"} default button "OK" giving up after 500

if the button returned of the result is "OK" then
tell application "System Events"
    if not (exists application process "Dictionary") then
        tell application "Dictionary" to activate           
    end if      
    set frontmost of process "Dictionary" to true
end tell

delay 2
tell application "System Events"
    set the clipboard to ""
    keystroke tab
    keystroke tab       
    keystroke "a" using command down        
    delay 1
    keystroke "c" using command down
    delay 1
    set selected_text to (the clipboard as text)        
end tell    

tell application "Mail"
    set myMessage to make new outgoing message at the beginning of outgoing messages with properties {subject:"Về: My Dictionary for Mac"}      
    tell myMessage to make new to recipient at beginning of to recipients with properties {address:"myemail@hotmail.com"}
    set myMessage's content to "My precoded message: " & (the clipboard as text)                
    set myMessage's visible to true
    activate    
end tell    
end if

So far so good. The above script works flawlessly. However, a big problem arises: The user cannot submit reports if s/he does not use or configure Mail.app to send email.

So my question is: Can I use an Apple script to send email without using Mail.app?

2
  • You had two questions in here. This site works better when there is only one question per question. That way, it's easier for other people to find solutions if they have the same problem. I've edited out your second question.
    – nohillside
    Jun 4 '17 at 15:08
  • 1
    Also, alternative means of getting user feedback quickly will move into software development which is off-topic on AskDifferent.
    – nohillside
    Jun 4 '17 at 15:10
2

Implementing the sending part of a mail client in AppleScript is probably rather a challenge, but there might be other means:

  • Use a mailto: scheme to launch the mail client the user is using. You won't be able to provide a mail template though (but you could prepare something in the clipboard and have the user paste it into the new mail), and it will fail for those users who don't use any mail client at all.
  • Create a web form on a web server of your choice and direct users to this site if they want to give feedback.
  • Collect user feedback within your application and just post it on your web server in the background.
2
  • I'm more interested in your third point. Do have any clearer prompts? Jun 4 '17 at 15:39
  • @NiamhDoyle Software development is off-topic on AD, it's better to raise the topic on a developer-focused site (e.g. Stackoverflow)
    – nohillside
    Jun 4 '17 at 15:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .