AS Studio - Variable Troubles - AAAARGHH
AS Studio - Variable Troubles - AAAARGHH
- Subject: AS Studio - Variable Troubles - AAAARGHH
- From: Trey Bean <email@hidden>
- Date: Fri, 25 Jan 2002 10:32:43 -0600
Hi all,
I have now been banging my head for about a week with zero results on
what seems to be a bug in applescript studio. Looking for any help to
show me the way or a workaround. And apologies upfront to anyone who
has seen this on apple's discussions.
I have a AS Script written in 1.8.1 on OS X with Script Editor. It is
basically a script that replies to clients with form emails. All the
user has to do is enter a first name, last name and email addres - hit a
button to tell the script what to send and voila - Email(s) have been
sent. It works great as an AS App except you can't paste into the dialog
boxes and I wanted to take advantage of the new UI, so I tried moving it
over to and AS Studio App. And there is only one hangup, in the
following funtion:
on sendMessage(theContent, theSubject, theFirstName, theLastName,
theEmailAddress)
tell application "Mail"
activate
set this_message to make new compose message at beginning of every
compose message
tell this_message
make new to recipient at beginning of to recipients with
properties {address:theEmailAddress, display name:theFirstName & " " &
theLastName}
set the subject to theSubject
set the content to theContent
end tell
make new message editor at beginning of every message editor
set the compose message of message editor 1 to this_message
end tell
end sendMessage
The problem is, is that when you tell mail to make a new message with
the properties, using the variables passed to the function it never sets
those properties, i.e. the to recipient is blank.
What is confusing is that it works fine as an applescript app. Same
funtion.
Any help with this at will be greatly appreciated.
Trey Bean