Re: Why it doesn't work?
Re: Why it doesn't work?
- Subject: Re: Why it doesn't work?
- From: Johnny AppleScript <email@hidden>
- Date: Wed, 06 Aug 2003 19:40:48 -0600
On 03/08/06 3:52 PM, "Marcus Rodrigues" <email@hidden> wrote:
>
The goal is to display a dialog in a remote machine, and, depending on
>
the button returned, send an e-mail to me with the answer.
OK, never could quite make your version work, but here's one that does the
same thing, plus has some additional variable handling. Watch that evil line
wrap...
global theRemoteMachine, theAlert, theMessage, a, b, a1, a2, theResult,
theAddress, theSubject
set theRemoteMachine to "eppc://192.200.9.79"
set {theAlert, theMessage} to {"Hey, Jose!", "Jose, etc."}
set {a, b, a1, a2} to {"Gostei, brigadu", "Achei idiota...", "Gostei!!!",
"Naum gostei =-("}
set {theAddress, theSubject} to {"email@hidden", "Resposta da
Jose"}
using terms from application "Finder"
with timeout of 40 seconds
tell application "Finder" of machine theRemoteMachine
activate
try
say theAlert
end try
set {theResult, GaveUp} to the {button returned, gave up} of
(display dialog theMessage buttons {a, b} giving up after 20)
if GaveUp is true then
set theResult to "No user response"
my localDialog()
else
my sendMail()
end if
end tell
end timeout
end using terms from
on sendMail()
using terms from application "Mail"
tell application "Mail" of machine theRemoteMachine
activate
if theResult is a then
set theContent to a1
else
set theContent to a2
end if
set newMessage to make new outgoing message with properties
{visible:true, subject:theSubject, content:theContent}
tell newMessage to make new to recipient at end of to recipients
with properties {address:theAddress}
send newMessage
end tell
end using terms from
end sendMail
on localDialog()
display dialog theResult
end localDialog
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.