简体   繁体   English

禁止Mail.app欢迎对话框发布Applescript设置

[英]Suppress Mail.app Welcome Dialog Post Applescript Setup

I'm attempting to configure the OSX Mail application via AppleScript. 我正在尝试通过AppleScript配置OSX Mail应用程序。 Upon running the AppleScript configuration, the "Welcome to Mail" dialog appears, when no accounts are setup. 运行AppleScript配置后,如果未设置任何帐户,则会出现“欢迎使用邮件”对话框。 But I'm trying to setup the account via AppleScript... 但是我正在尝试通过AppleScript设置帐户...

Is it possible to configure the Mail application, and suppress the Welcome to Mail dialog? 是否可以配置“邮件”应用程序,并取消“欢迎使用邮件”对话框?

I believe the problem is centered around this command: 我相信问题集中在以下命令:

tell application "Mail"
activate

This is essentially launching the application and then my script proceeds to configure. 这实际上是在启动应用程序,然后我的脚本继续进行配置。 If you cancel out of the "Welcome to Mail" dialog, the Mail application quits. 如果您取消“欢迎使用邮件”对话框,邮件应用程序退出。 If you already have an account setup, the AppleSript command to setup an account works just fine. 如果您已经有一个帐户设置,那么使用AppleSript命令设置一个帐户就可以了。

Does anyone know if there is a way to suppress this window? 有谁知道是否有抑制此窗口的方法?

I don't know how to suppress it from popping up, but you could hide it using this code: 我不知道如何阻止它弹出,但是您可以使用以下代码将其隐藏:

tell application "System Events" to set visible of process "Mail" to false

Of course, later on you could show it to the user again, using tell application "System Events" to set visible of process "Mail" to true 当然,以后您可以使用告诉应用程序“系统事件”将进程“邮件”的可见设置为true再次向用户显示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM