Я установил правило в Apple Mail для запуска яблочного скрипта «Скачать и открыть ссылку». Я хотел бы, чтобы этот скрипт загружал URL-адрес в почтовом сообщении и после загрузки открывал файл.
Не знаю, как начать с этого. Вот код, который не работает:
using terms from application "Mail"
on perform mail action with messages newMessages
repeat with newMessage in newMessages
tell application "Mail"
set contentLink to (content of newMessage)
end tell
set the destination_file to ("/Users/thomas/Downloads/file")
tell application "URL Access Scripting"
download contentLink to destination_file replacing yes
end tell
end repeat
end perform mail action with messages
end using terms from