Ich entwickle ein benutzerdefiniertes Wörterbuch-Add-on, um es der Dictionary.app von Mac hinzuzufügen.
Ich möchte, dass mein Benutzer mir als Entwickler die Fehler des Wörterbuch-Add-Ons oder seine/ihre Kommentare (falls vorhanden) meldet. Bisher habe ich das folgende AppleScript verwendet, um mir solche Berichte mit Mail.app zu senden.
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 weit, ist es gut. Das obige Skript funktioniert einwandfrei. Allerdings taucht ein großes Problem auf:The user cannot submit reports if s/he does not use or configure Mail.app to send email.
Meine Frage lautet also: Kann ich ein Apple-Skript verwenden, um E-Mails zu senden, ohne Mail.app zu verwenden?
Das Implementieren des sendenden Teils eines Mail-Clients in AppleScript ist wahrscheinlich eine ziemliche Herausforderung, aber es könnte andere Mittel geben:
mailto:
Schema, um den E-Mail-Client zu starten, den der Benutzer verwendet. Sie können jedoch keine E-Mail-Vorlage bereitstellen (aber Sie könnten etwas in der Zwischenablage vorbereiten und den Benutzer in die neue E-Mail einfügen lassen), und es wird für Benutzer fehlschlagen, die überhaupt keinen E-Mail-Client verwenden .
kein Hang
kein Hang