使用 applescript/automator 将多个项目附加到新的 Outlook 邮件 [英] Using an applescript/automator to attach multiple items to a new Outlook message

查看:27
本文介绍了使用 applescript/automator 将多个项目附加到新的 Outlook 邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经研究(在网上找到的)如何将 Finder 中的单个项目附加到新的 Outlook 邮件中.我已经大量使用这种格式 - 更改了selecteditem"和选择以及其他一些更重大的更改 - 但我无法弄清楚如何一次将多个项目附加到新的 Outlook 消息.

I've worked out (found online) how to attach a single item from Finder to a new Outlook message. I've played with this format a good amount - changed 'selecteditem' and selection and some other more major changes - but I can't work out how to get more than one item to attach to a new outlook message at a time.

每条新的 Outlook 邮件仅附加一个项目.Automator 中没有 Outlook Automator 选项 - 我认为 Office 365 取消了它们.

Only a single item attaches to each new outlook message. There are no Outlook Automator options in Automator - I think Office 365 did away with them.

我目前的脚本如下:

tell application "Finder" to set selectedItem to item 1 of (get selection)
set theAttachment to selectedItem as alias
set fileName to name of selectedItem

  tell application "Microsoft Outlook"
  set newMessage to make new outgoing message with properties {subject:fileName}
tell newMessage
   make new attachment with properties {file:theAttachment}
  end tell
  open newMessage
  get newMessage 
end tell

我目前正在尝试在 Automator 中将此脚本用作服务,因此我可以通过右键单击选项将文件直接发送到新的 Outlook 邮件.目前是这样设置的.

I'm currently trying use this script in Automator as a service so I have a right click option to send files directly to a new Outlook message. It's currently setup like this.

推荐答案

您的 Automator 服务从 Finder 获取文件或文件夹".这部分没问题.只需要修改applescript的内容.

Your Automator Service gets "Files or Folders" from Finder. This part is OK. Just the content of the applescript must be changed.

要读取这些输入(从 Finder 中选择的文件),您必须使用运行时"处理程序,其中输入"将是选择的文件.

To read these inputs (the selected files from Finder), you must use the "on run" handler where "input" will be the selected files.

下面的脚本必须替换您当前的脚本.我假设您的电子邮件的主题应该是多选的第一个选定文件的名称:

The script bellow must replace your current script. I assumed that the subject of your email should be the name of the first selected file in case of multiple selection:

on run {input, parameters}
set SelectedItems to input
tell application "Finder" to set fileName to name of first item of SelectedItems

tell application "Microsoft Outlook"
    set newMessage to make new outgoing message with properties {subject:fileName}
    tell newMessage
        repeat with aFile in SelectedItems -- the loop through all selected items
            make new attachment with properties {file:aFile}
        end repeat
    end tell
    open newMessage
    get newMessage
end tell
return input
end run 

最重要的是,我有 2 条评论:

On top of that, I have 2 comments :

1) 当您选择文件夹时,此脚本不会过滤大小写.在循环内部,您可能需要添加一个if"测试来检查文件或文件夹,并在选择是文件夹的情况下采取行动.

1) this script does not filter the case when you select a folder. Inside the loop, you may want to add a "if" test to check file or folder and take action in case selection is a folder.

2) 我不明白您要执行的整个过程:选择文件,转到菜单服务"以运行此服务,这将创建一个带有这些文件作为附件的新 Outlook 邮件......您可以通过以下方式完成所有这些选择文件并将它们拖放到 Dock 中的 Outlook 图标上.它会立即创建一个包含所有附件的新空白邮件.

2) I do not understand the overall process you want to perform: Select files, go to menu Service to run this service, which creates a new Outlook message with these files as attachment...You can do all this by just selecting the files and drag/drop them on the Outlook icon in the dock. it will immediately create a new blank message with all the attached files.

这篇关于使用 applescript/automator 将多个项目附加到新的 Outlook 邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆