2015-06-03 2 views
0

Я запускаю некоторые applescript. Цель состоит в том, чтобы открыть Mac Mail и создать новое сообщение с вложением, которое находится на рабочем столе пользователя.applescript - приложение при начале электронной почты

В настоящее время он работает, НО ... Вставка вставлена ​​ПОСЛЕ электронной почты, и нам нужно, чтобы вложение было расположено перед сигнатурой электронной почты (в начале письма).

заблаговременно за любую помощь, которую вы можете предоставить!

код ниже ...

set theAttachment to "{theDesktopPath and file name}" 
set RecipientAddress to "[email protected]" 
set RecipientName to "Joe" 
set TheSubject to "Estimate" 

tell application ”Mail” 
set newMessage to make new outgoing message with properties {subject:theSubject, visible:true} 
tell newMessage 
make new to recipient with properties {name:recipientName, address:RecipientAddress} 
tell content of newMessage 
make new attachment with properties {file name:theAttachment as alias} at after the last paragraph 
end tell 
end tell 
activate 
end tell 

ответ

0

Изменить "после того, как последний", чтобы "перед первым", как так:

set theAttachment to "{theDesktopPath and file name}" 
set RecipientAddress to "[email protected]" 
set RecipientName to "Joe" 
set TheSubject to "Estimate" 

tell application "Mail" 
    set newMessage to make new outgoing message with properties {subject:TheSubject, visible:true} 
    tell newMessage 
     make new to recipient with properties {name:RecipientName, address:RecipientAddress} 
     tell content of newMessage 
      make new attachment with properties {file name:theAttachment as alias} at before the first paragraph 
     end tell 
    end tell 
    activate 
end tell 
+0

работал красиво! Спасибо вам большое за это! – happymac

Смежные вопросы