我正在试图弄清楚如何使用AppleScript进行编码,你可以通过阅读代码来弄清楚我在做什么。
我的目标是将文本框放在电子邮件正文中。我可以在代码中使用一些帮助。
如果有人可以转移它,比如JavaScript或其他很好的东西。
display dialog "Hey, Would You Like To Go To A Movie Sometime?" default answer linefeed buttons {"Yeah, I'd Love To", "No Thanks"} default button "Yeah, I'd Love To"
set the choice to the button returned of the result
if the choice is "Yeah, I'd Love To" then
do shell script "open -a \"Google Chrome\" \"" & "https://mail.google.com/mail/?view=cm&fs=1&to=owenemcg@gmail.com&su=Movies&body= " & "\""
else
do shell script "open -a \"Google Chrome\" \"" & "https://mail.google.com/mail/?view=cm&fs=1&to=owenemcg@gmail.com&su=Movies&body=No thank you, thanks for the offer though " & "\""
end if
答案 0 :(得分:0)
display dialog
会返回包含密钥text returned
,button returned
和gave up
的记录。您还需要考虑text returned
:
set {text returned:textReturned, button returned:buttonReturned} to display dialog "Hey, Would You Like To Go To A Movie Sometime?" default answer linefeed buttons {"Yeah, I'd Love To", "No Thanks"} default button "Yeah, I'd Love To"
if buttonReturned is "Yeah, I'd Love To" then
set param to textReturned
else
set param to "No thank you, thanks for the offer though"
end if
do shell script "open -a 'Google Chrome' " & quoted form of ("https://mail.google.com/mail/?view=cm&fs=1&to=owenemcg@gmail.com&su=Movies&body=" & param)