Extract URL from Mail message
I have the following problem:
Every week we receive an email which contains a secure URL ( https://) with always different username and password to download a ".tar" file.
Since I'm new to Applescript I tried to extract the paragraph of the email message with the line which contains the URL, but doesn't seem to work:
-------------------------------------------------------------------------------
tell application "Mail"
set theMessages to message 1 of mailbox "EXAMPLE" of account "AccountTest" whose subject begins with "Data request"
set theContent to content of theMessages
set someData to paragraphs of theContent
repeat with someData in theContent
if someData begins with "https://" then
set theURL to paragraph of someData
else
set theURL to paragraph 18 of theContent -- this works but this line can change weekly
end if
end repeat
end tell
--------------------------------------------------------------------------------
Any help or suggestions would be greatly appreciated.
Cheers,
gilles
iMac 24, Mac OS X (10.5.5)