Re: Scripting mail at add an Atachment
Re: Scripting mail at add an Atachment
- Subject: Re: Scripting mail at add an Atachment
- From: John Mitchell <email@hidden>
- Date: Thu, 6 Jan 2005 19:30:23 +1100
Title: Re: Scripting mail at add an
Atachment
Mivchelle you helped me out previously.
I use this routine to create a Mailbox (actually, functionally
a mail folder)
tell
application
"Mail"
try
make new mailbox
at
beginning with
properties {name:newMailFolder}
on
error
errMsg number errNum
display
dialog "Could not
create new category folder <" & newMailFolder & "> (Mail)" & return ¬
&
errMsg buttons {"Quit"} default button 1
return {false}
end
try
end
tell
eg
set {flag}
to
createMailFolder("Mail", "",
"Babble") of
me
this works; however when I try to make a mailbox in it,
using this routine:
tell
application
"Mail"
if
not (exists mailbox mailBoxName of
mailbox
thismailFolder)
then
try
set
folderRef
to (make new mailbox at beginning of mailbox thismailFolder ¬
with
properties {name:mailBoxName})
on
error
display
dialog "Cannot make
new mailbox " &
mailBoxName &
"(Mail)"
return {false,
boxExists}
end
try
else
display
dialog "Mailbox <"
&
mailBoxName & ">
already exists" &
return ¬
&
"in mail folder " & thismailFolder buttons
{"Continue"}
default button
"Continue"
set
boxExists
to true
end
if
end
tell
eg
set {flag, folderRef} to
createMailBox("Mail",
"", "Projects", "AHF Defence
Headquarters") of
me
there is no error message but nothing is created. This same
result happens if I modify the createMailFolder routine to create a
mailbox inside a Mailbox. If the mailbox exists it behaves correctly,
ie it finds mailbox "Fawlty Towers Condominiums" (see
attachment)
any clues?
At 21:58 -0700 29/8/04, Michelle Steiner wrote:
On Aug 29, 2004, at 7:59 PM, John
Mitchell wrote:
have bee trying to script an attachment
to Mail
This should do it:
set the fileAttachment to ((choose file) as text)
tell application "Mail" to tell the content of (make new
outgoing message with properties {visible:true}) to make new
attachment with properties {file name:fileAttachment} at after its
last paragraph
--and whatever other properties are needed
-- Michelle
--
"The past is like a foreign country. They do things
differently there." --Leslie Poles Hartley
--
regards
John
--------------------------------------------------------------------------------------------------------------------------------------------
John Mitchell, Director, IFC
Interoperability, Graphisoft R&D Rt
11 Terrell Avenue, Wahroonga, NSW
2076 Australia
Email:
email@hidden
Tel: +61 (2) 9489 3785 Fax:
+61 (2) 9489 4035
Mob:+61 410 318 131
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden