- 发行说明
- 入门指南
- 教程
- 自动化项目
- 创建自动化
- 自动化基础知识
- 自动化最佳实践
- PowerPoint 自动化
- 常见活动
明确定义要自动化的手动流程
在开始设计自动化项目之前,请创建要自动化的手动流程的图表,并将其分解为每个步骤。这可以帮助您确定其自动化所需活动的顺序。
使用有助于加速自动化设计的工具
- Base new projects on project templates, fully working automation projects for common processes.
- Use common scenarios, reusable pieces of automation for common tasks, to add multiple activities at once.
- 使用应用程序/网页录制器,根据您在屏幕上执行的操作自动生成用户界面自动化活动。
确定要使用的正确活动
Use the dedicated activities when working with Excel, Mail, Word, and PowerPoint data, and when performing file and folder operations. For interactions with all other applications, use UI automation activities.
在整个自动化项目中使用描述性名称
使用描述每个组件用途的名称让您可以更容易地识别组件,尤其是当多次使用相同类型的组件时。这适用于项目名称、活动名称、添加到项目中的资源(Excel 和 PowerPoint 文件、电子邮件帐户)的“引用”名称、“遍历”活动内迭代中当前项目的名称(默认情况下为 CurrentRow、CurrentMail、CurrentFile)以及在自动化中保存以备后用的值的名称。
记录您的自动化项目
通过添加注释以及有关其活动的信息来记录项目中的活动。如果您打算与其他人共享自动化项目,这尤其重要,因为这可以帮助他们了解自动化项目的工作方式。要将注释添加到活动,请右键单击该活动,然后选择“注释” > “添加注释”。
在设计自动化时经常分析和运行自动化
- Analyze your project by running the Workflow Analyzer. This checks for errors in how activities are configured and verifies that the project follows design guidelines defined through Workflow Analyzer rules. Click Analyze in the StudioX ribbon and view the results of the analysis in the Error List panel. For more information, see About Workflow Analyzer.
- 运行您的项目,并检查结果是否符合预期。运行自动化的次数越多,就越容易发现潜在的问题点。
- 如果在运行项目时发生错误,请注意该错误消息,其中可能包含有关错误原因和修复方法的重要信息。使用错误对话框中的选项可重试产生错误的活动,跳至下一个活动或项目,或停止执行。
仅运行部分自动化以隔离潜在的错误
- 在项目中的某个点停止执行或从某个点开始执行。右键单击任何活动,然后选择:
- “运行至该活动”,以执行项目中该活动之前(包含该活动)的所有活动。
- “自该活动运行”,以从该活动开始执行项目中的所有活动。
- 禁用可能导致错误的单个活动,并在没有此类活动的情况下执行项目。您可以右键单击某个活动并选择“禁用活动”,以禁用该活动。被禁用的活动在项目图中的“注释掉”容器中显示为灰色并被包围。要重新启用禁用的活动,请右键单击“注释掉”容器,然后选择“启用活动”。
在自动化的关键点生成消息
在工作流中某些位置放置的消息可帮助您跟踪项目的进度,并提供有关其他活动执行结果的信息。您可以使用以下活动来显示消息:
-
Write Line displays messages in the Output panel without interrupting the execution of the project.
For example, when repeating activities for each row in an Excel file, add a Write Line activity as the first activity inside For Each Excel Row and configure it to display a message that includes the contents of a cell from each row. You can indicate the cell by selecting the column from the CurrentRow option in the
menu available in the Text Builder. Generating a message whenever the automation begins processing a row allows you to check whether the rows are processed as expected. -
Message Box displays a dialog box with a message, pausing the execution of the automation project until a button is clicked in the dialog box.
例如,在最后一个操作 Word 文件中数据的活动之后,添加一个“消息框”活动,该活动将显示消息“Word 文档已处理完成”。这样可以确认 Word 活动已完成,并且自动化可以移至下一个活动。
完成项目设计后,请在发布项目之前删除这些活动。
保护敏感信息
- 不要将凭据直接添加到项目中。使用“获取用户名/密码”活动,您可以向项目添加凭据,并将其安全地存储在 Windows 凭据管理器中。
- 不要将包含敏感数据的文件存储在项目文件夹中,尤其是当您计划与他人共享自动化时。默认情况下,发布自动化时,项目文件夹中的所有文件都将包含在包中。