This is my first attempt at Applescript. I 'm try to write a script to move messages that are older than 30 days from one mailbox to another. Here is my script:
tell application "Mail"
activate
set lwdgInbox to mailbox "INBOX" in account "LWDG - Jules"
set archiveBox to mailbox "Archive"
--set numMsg to count of messages in archiveBox
--display dialog numMsg
set dateLimit to 24 * 3600 * 30 -- 30 days
repeat with msg in messages in lwdgInbox
set dateRcvd to date received in msg
if ((current date) - dateRcvd) > dateLimit then
display dialog date string of dateRcvd
move the msg to archiveBox
end if
end repeat
end tell
When I run it I get "Mail got an error: NSInternalScriptError" in the evnt log. is there anyone wh would knw why this is?