set mylist to (list folder "Macintosh HD1:Users:jbradfield:Desktop" without invisibles)
set linebreaks to ""
repeat with i from 1 to (number of items in mylist)
set linebreaks to (linebreaks & (item i of mylist) & return) as string
end repeat
tell application "Microsoft Outlook"
--activate
CreateMail Body (linebreaks as string) Recipients "jbradfield" Subject ((number of items in mylist) & " New Images on NAIIS") as string without Display
end tell
This gives me
error
this used to work but for some reason stopped
btw this is a snipet of a larger script
i have narrowed the problem down to the Body of the email but can’t figure it out
What happens if you coerce ‘number of items in myList’ to text?
CreateMail Body (linebreaks as string) Recipients "jbradfield" Subject (((number of items in mylist) as text) & " New Images on NAIIS") as string without Display
this is from the dictionary of microsoft outlook (even though it says outlook express)
the error i receive is:
wierd thing is this used to work the only thing i think that is different is i use script editor 2.0(beta) instead of 1.9 – i tried to run the same script in 1.9 and i still have same problem
PS when i look in the event log i do see the “body” portion as listing all the stuff that should be there
After further tinkering i am convinced that Micro$oft dosen’t want me to do it now they have installed a time delay virus that will no longer allow applescripting of Outlook
j/k
AS may be having trouble coercing the list into the body of the email don’t know why
ie when i try to
tell application "Microsoft Outlook"
--activate
CreateMail Body ((current date) as string) Recipients "jbradfield" Subject ((number of items in mylist) & " New Images on NAIIS") as string without Display
CreateMail Body ((current date) as string) Recipients "jbradfield" Subject ((number of items in mylist) & " New Images on NAIIS") as string without Display
With:
CreateMail with properties {Body:((current date) as string), Recipients:{"jbradfield"}, Subject:((number of items in mylist) & " New Images on NAIIS") as string} without Display
This is tough when I can’t test the code to see if it even compiles. :?
CreateMail with properties {Body:((current date) as string), Recipients:{"jbradfield"}, Subject:((number of items in mylist) & " New Images on NAIIS") as string} without Display
tell application "Finder"
--choose folder with prompt ""
set linebreaks to ""
set myFolder to folder "Macintosh HD1:Users:jbradfield:Desktop:move to enlarged"
set naiislist to name of every item in myFolder -- as string
set itemcount to the number of items in myFolder
repeat with i from 1 to (count items in naiislist)
set linebreaks to (linebreaks & (item i of naiislist) & return) as string
end repeat
tell application "Microsoft Outlook" to CreateMail Body linebreaks ¬
Recipients ¬
"jbradfield" Subject ((itemcount as string) & " New Images on NAIIS") with Display
end tell
funny thing is in the events window i can see everyting the way it should be as far as the body the recipients and the subject everything shows up fine it just gives an error some data was the wrong type
Is there something different between a list of file names and a list of text?
becausea list like my previous post will work
and this works the way i want in os9
agh (&#^%#$%)$%_ just venting any body out there understand