2015-10-06 23 views
0

我想創建一個應用程序,它將採用pdf作爲輸入(拖放)併發送包含用戶選擇的主題的電子郵件。將文件從第二個自動調整變量傳遞到applescript

我已經創建了一個幾乎可以工作的自動工作流程。我沒有得到的唯一部分是將丟棄的文件傳遞給applescript,以便它將它附加到郵件內

有人可以幫我解決這個問題嗎?

預先感謝您的幫助!

在這裏你可以下載壓縮工作流程 http://s000.tinyupload.com/index.php?file_id=12980776511398698508

,這裏是在Automator的工作流程結束時的AppleScript。該問題與通過輸入的第二個項目應該是包含在Automator的變量文件做

on run {input, parameters} 

set theSubject to first item of input -- the subject 
set myFiles to second item of input -- the file 

set theContent to "" -- the content 
set theAddress to "[email protected]" -- the receiver 
set theAttachmentFile to myFiles 

tell application "Mail" 
    set msg to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true} 
    tell msg to make new to recipient at end of every to recipient with properties {address:theAddress} 
    tell msg to make new attachment with properties {file name:theAttachmentFile as alias} 
    send msg 
end tell 

end run 

回答

0

腳本輸入參數中包含從以前的Automator動作「獲取變量」所有變量的列表,以相同的順序。但你需要確保你只能得到你正在尋找的變量列表。在您當前的Automator流程中,選擇「獲取No_Fax的值」操作並選擇「忽略條目」。那麼流程將只在輸入參數中堆疊No_Fax和Files。輸入項目1將是No_Fax,項目2將是第一個文件,項目3,第二個文件....

相關問題