2017-08-26 4 views
-3

私はAppleScriptでコードする方法を理解しようとしていますが、コードを読むことで私が何をしているのか分かります。私はAppleScriptコードで従属変数を作成するのに助けが必要です

私の目標は、テキストボックスを電子メールの本文に挿入することです。私はコードにいくつかの助けを使うことができます。

誰かがそれを転送することができれば、JavaScriptやniceなものを言うことができます。

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&[email protected]&su=Movies&body= " & "\"" 
else 
    do shell script "open -a \"Google Chrome\" \"" & "https://mail.google.com/mail/?view=cm&fs=1&[email protected]&su=Movies&body=No thank you, thanks for the offer though " & "\"" 
end if 
+0

このコードでどのような不満があっても、あなたのタイトルを編集できますか? –

答えて

0

display dialogキーtext returnedbutton returnedgave 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&[email protected]&su=Movies&body=" & param) 
関連する問題