Total n00b here, definitely not a programmer. Would love some assistance with an applescript. I'm basically trying to extract a subject line from emails in a particular folder underneath my inbox. I need it to yank out the subject line, look for some numbers (ex. 123456) and pull out the last 4 digits. Then put that into a text file. Below is what I have so far, but it's not working. I'm not getting any output at all. Any guidance would be greatly appreciated!
tell application "Microsoft Outlook"
set theAccount to exchange account “my account"
set topFolder to folder "Inbox"
set subFolder to folder “Stuff"
set theMessages to messages of subFolder
set folderPath to ((path to home folder from user domain as string) & “emails")
repeat with aMessage in theMessages
my SetSubject(subject of aMessage)
end repeat
end tell
on SetSubject(theSubject)
tell application "Microsoft Outlook"
try
save theSubject in ((path to home folder from user domain as string) & “emails" & “numbers.txt" as string)
end try
end tell
end SetSubject
end