Applescript 使用 Microsoft Outlook 联系人填充对话框列表
总之,
我正在尝试创建一个applescript,它允许我创建一个word文档(商业提案)。其中之一是能够使用 applescript 从 Microsoft Outlook 中选择客户端。
我知道如何在 VBA 中执行此操作,但在 Applescript 中我似乎无法弄清楚。基本上,我需要一个对话框,其中包含所有 Outlook 联系人的列表,我可以从中选择一个。
非常感谢, -J
All,
I'm attempting to create an applescript that allows me to create a word document (a business proposal). One part is being able to use applescript to select the client from micorsoft outlook.
I know how to do this in VBA but in Applescript I can't seem to figure it out. Basically I need a dialog box that either has a list of all my Outlook contacts from which I can select one.
Much appreciated,
-J
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
又快又脏,但是可行(Office 2008) 该
脚本本质上有两个部分:获取联系人姓名和显示信息。获取联系人很容易,因为
contacts
是应用程序本身的属性。在 40 多个联系人中运行此操作只需一秒钟。呈现数据并进行选择并不是那么明显。要呈现的数据必须是一个字符串。老实说,我忘记了为什么我有
as text
悬在末尾,但我似乎记得,如果所有内容都作为某种字符串处理,那么这样做会更容易。一旦验证了选择(返回“False”意味着用户单击了取消
按钮),您就可以继续使用我放置显示对话框
的字符串。不幸的是,您没有得到行号或类似的方便信息。它只是无法以这种方式工作,因此您必须做一些捏造才能返回到相应的contact
对象本身。加盐调味...
Quick and dirty, but this works (Office 2008)
There are essentially two parts to the script: getting the contact names and presenting the information. Getting the contacts is easy because
contacts
is a property of the application itself. Running this in 40+ contacts only takes a second.Presenting the data and getting the selection isn't so obvious. The data to be presented has to be a string. Honestly, I forget why I have
as text
dangling off the end, but I seem to remember that doing this was easier if everything was handled as a string of some kind. Once the selection has been verified—having "False" returned means the user clicked thecancel
button—you are then able to carry on with the string where I placed thedisplay dialog
. Unfortunately, you don't get the row number or anything convenient like that. It just doesn't work that way, so you will have to do a bit of fudging to get back to the correspondingcontact
object itself.Add salt to taste...