-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.xaml
181 lines (181 loc) · 12.8 KB
/
Main.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<Activity mc:Ignorable="sap sap2010" x:Class="Main" this:Main.Save_as_File="True" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:sd="clr-namespace:System.Drawing;assembly=System.Drawing" xmlns:swf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" xmlns:this="clr-namespace:" xmlns:ui="http://schemas.uipath.com/workflow/activities" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<x:Members>
<x:Property sap2010:Annotation.AnnotationText="User can decide to save the snipped picture to a png file." Name="Save_as_File" Type="InArgument(x:Boolean)" />
<x:Property sap2010:Annotation.AnnotationText="File folder where the saved file of the snipped picture is stored." Name="Folder_Path" Type="InArgument(x:String)" />
</x:Members>
<mva:VisualBasic.Settings>
<x:Null />
</mva:VisualBasic.Settings>
<sap:VirtualizedContainerService.HintSize>647,2081</sap:VirtualizedContainerService.HintSize>
<sap2010:WorkflowViewState.IdRef>ActivityBuilder_1</sap2010:WorkflowViewState.IdRef>
<TextExpression.NamespacesForImplementation>
<scg:List x:TypeArguments="x:String" Capacity="56">
<x:String>System.Activities</x:String>
<x:String>System.Activities.Statements</x:String>
<x:String>System.Activities.Expressions</x:String>
<x:String>System.Activities.Validation</x:String>
<x:String>System.Activities.XamlIntegration</x:String>
<x:String>Microsoft.VisualBasic</x:String>
<x:String>Microsoft.VisualBasic.Activities</x:String>
<x:String>System</x:String>
<x:String>System.Collections</x:String>
<x:String>System.Collections.Generic</x:String>
<x:String>System.Data</x:String>
<x:String>System.Diagnostics</x:String>
<x:String>System.Drawing</x:String>
<x:String>System.IO</x:String>
<x:String>System.Linq</x:String>
<x:String>System.Net.Mail</x:String>
<x:String>System.Xml</x:String>
<x:String>System.Xml.Linq</x:String>
<x:String>UiPath.Core</x:String>
<x:String>UiPath.Core.Activities</x:String>
<x:String>System.Windows.Markup</x:String>
<x:String>System.Collections.ObjectModel</x:String>
<x:String>System.Activities.DynamicUpdate</x:String>
<x:String>System.Reflection</x:String>
<x:String>System.Runtime.InteropServices</x:String>
<x:String>AttendedRobotStatus.Activities</x:String>
<x:String>Microsoft.VisualBasic.CompilerServices</x:String>
<x:String>System.Text.RegularExpressions</x:String>
<x:String>System.Threading.Tasks</x:String>
<x:String>System.Threading</x:String>
<x:String>UiPath.Shared.Activities</x:String>
<x:String>UiPath.Credentials.Activities</x:String>
<x:String>System.Runtime.Serialization</x:String>
</scg:List>
</TextExpression.NamespacesForImplementation>
<TextExpression.ReferencesForImplementation>
<scg:List x:TypeArguments="AssemblyReference" Capacity="50">
<AssemblyReference>System.Activities</AssemblyReference>
<AssemblyReference>Microsoft.VisualBasic</AssemblyReference>
<AssemblyReference>mscorlib</AssemblyReference>
<AssemblyReference>System.Data</AssemblyReference>
<AssemblyReference>System</AssemblyReference>
<AssemblyReference>System.Drawing</AssemblyReference>
<AssemblyReference>System.Core</AssemblyReference>
<AssemblyReference>System.Xml</AssemblyReference>
<AssemblyReference>System.Xml.Linq</AssemblyReference>
<AssemblyReference>PresentationFramework</AssemblyReference>
<AssemblyReference>WindowsBase</AssemblyReference>
<AssemblyReference>PresentationCore</AssemblyReference>
<AssemblyReference>System.Xaml</AssemblyReference>
<AssemblyReference>UiPath.System.Activities</AssemblyReference>
<AssemblyReference>UiPath.UiAutomation.Activities</AssemblyReference>
<AssemblyReference>System.Data.DataSetExtensions</AssemblyReference>
<AssemblyReference>AttendedRobotStatus</AssemblyReference>
<AssemblyReference>System.ServiceModel</AssemblyReference>
<AssemblyReference>Microsoft.Bcl.AsyncInterfaces</AssemblyReference>
<AssemblyReference>System.ValueTuple</AssemblyReference>
<AssemblyReference>System.ComponentModel.Composition</AssemblyReference>
<AssemblyReference>System.Memory</AssemblyReference>
<AssemblyReference>UiPath.OCR.Activities.Design</AssemblyReference>
<AssemblyReference>UiPath.UIAutomationCore</AssemblyReference>
<AssemblyReference>UiPath.System.Activities.Design</AssemblyReference>
<AssemblyReference>UiPath.Credentials.Activities</AssemblyReference>
<AssemblyReference>System.Runtime.Serialization</AssemblyReference>
<AssemblyReference>UiPath.Mail</AssemblyReference>
<AssemblyReference>System.Runtime.WindowsRuntime</AssemblyReference>
</scg:List>
</TextExpression.ReferencesForImplementation>
<Sequence sap2010:Annotation.AnnotationText="Steffen Tenschert (UiPath) - 12-Mar-2021 - Version 1.1
Max Ott (UiPath) - 14-June-2021 - Version 1.2

This 'A Robot for Every Person' (AREP) process snips the image you indicated on the screen, saves it to clipboard for fast pasting into another applications and save the image file automatically in your personal user Picture folder
This project is developed and tested with following official package versions & one UiPath community team package:

UiPath.System.Activities = 20.10.4
UiPath.UIAutomation.Activities = 20.10.9
---------------------------------------------------------------------" sap:VirtualizedContainerService.HintSize="526,2016" sap2010:WorkflowViewState.IdRef="Sequence_2">
<Sequence.Variables>
<Variable x:TypeArguments="ui:UiElement" Name="indication" />
<Variable x:TypeArguments="ui:Image" Name="image" />
<Variable x:TypeArguments="x:String" Name="strOutput" />
<Variable x:TypeArguments="x:String" Name="strAttachmentPath" />
</Sequence.Variables>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
<x:Boolean x:Key="IsAnnotationDocked">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ui:WindowScope ApplicationWindow="{x:Null}" SearchScope="{x:Null}" Window="{x:Null}" ContinueOnError="True" DisplayName="Minimise UiPath Assistant" sap:VirtualizedContainerService.HintSize="484,260" sap2010:WorkflowViewState.IdRef="WindowScope_1" InformativeScreenshot="94eecaf2ad5704623a5283d543a7ebcc" Selector="<wnd app='uipath.assistant.exe' omit:cls='Chrome_WidgetWin_1' title='UiPath Assistant' />" TimeoutMS="1000">
<ui:WindowScope.Body>
<ActivityAction x:TypeArguments="x:Object">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:Object" Name="ContextTarget" />
</ActivityAction.Argument>
<Sequence DisplayName="Do" sap:VirtualizedContainerService.HintSize="242,114" sap2010:WorkflowViewState.IdRef="Sequence_1">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ui:MinimizeWindow Window="{x:Null}" ContinueOnError="True" DisplayName="Minimize Window" sap:VirtualizedContainerService.HintSize="200,22" sap2010:WorkflowViewState.IdRef="MinimizeWindow_1" />
</Sequence>
</ActivityAction>
</ui:WindowScope.Body>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
<x:Boolean x:Key="IsPinned">False</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</ui:WindowScope>
<ui:IndicateOnScreen ContinueOnError="True" DisplayName="Indicate On Screen-area to OCR" HidePreview="True" sap:VirtualizedContainerService.HintSize="484,22" sap2010:WorkflowViewState.IdRef="IndicateOnScreen_1" SelectScreenRegion="True" SelectedUiElement="[indication]" />
<ui:TakeScreenshot WaitBefore="{x:Null}" ContinueOnError="True" DisplayName="Take Screenshot of an area " sap:VirtualizedContainerService.HintSize="484,68" sap2010:WorkflowViewState.IdRef="TakeScreenshot_1" Screenshot="[image]">
<ui:TakeScreenshot.Target>
<ui:Target ClippingRegion="{x:Null}" Selector="{x:Null}" Element="[indication]" Id="9ad1f982-b624-49ff-b37f-e4acb48cf985">
<ui:Target.TimeoutMS>
<InArgument x:TypeArguments="x:Int32" />
</ui:Target.TimeoutMS>
<ui:Target.WaitForReady>
<InArgument x:TypeArguments="ui:WaitForReady" />
</ui:Target.WaitForReady>
</ui:Target>
</ui:TakeScreenshot.Target>
</ui:TakeScreenshot>
<InvokeMethod DisplayName="Invoke method" sap:VirtualizedContainerService.HintSize="484,134" sap2010:WorkflowViewState.IdRef="InvokeMethod_1" MethodName="SetImage" TargetType="swf:Clipboard">
<InArgument x:TypeArguments="sd:Image">[image]</InArgument>
</InvokeMethod>
<If Condition="[Folder_Path = ""]" sap:VirtualizedContainerService.HintSize="484,237" sap2010:WorkflowViewState.IdRef="If_3">
<If.Then>
<Assign sap:VirtualizedContainerService.HintSize="262,60" sap2010:WorkflowViewState.IdRef="Assign_5">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[Folder_Path]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">[Environment.GetFolderPath(Environment.SpecialFolder.Desktop)]</InArgument>
</Assign.Value>
</Assign>
</If.Then>
</If>
<If Condition="[Save_as_File = True]" DisplayName="Save Image if required" sap:VirtualizedContainerService.HintSize="484,560" sap2010:WorkflowViewState.IdRef="If_1">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
<x:Boolean x:Key="IsPinned">False</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<If.Then>
<Sequence sap:VirtualizedContainerService.HintSize="376,383" sap2010:WorkflowViewState.IdRef="Sequence_3">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<Assign sap:VirtualizedContainerService.HintSize="334,60" sap2010:WorkflowViewState.IdRef="Assign_6">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[strAttachmentPath]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">[Folder_Path+"\UiPath_Snipped_"+System.Text.RegularExpressions.Regex.Replace(Now.ToString,"/|:","")+".png"]</InArgument>
</Assign.Value>
</Assign>
<ui:SaveImage DisplayName="Save Image" FileName="[strAttachmentPath]" sap:VirtualizedContainerService.HintSize="334,92" sap2010:WorkflowViewState.IdRef="SaveImage_1" Image="[image]" />
<ui:MessageBox Caption="{x:Null}" ChosenButton="{x:Null}" DisplayName="Message Box" sap:VirtualizedContainerService.HintSize="334,59" sap2010:WorkflowViewState.IdRef="MessageBox_1" Text="["Image saved to " + Folder_Path]" />
</Sequence>
</If.Then>
</If>
<ui:MessageBox Caption="{x:Null}" ChosenButton="{x:Null}" DisplayName="Message Box" sap:VirtualizedContainerService.HintSize="484,59" sap2010:WorkflowViewState.IdRef="MessageBox_2" Text="["Snippet copied to clipboard"]" />
<ui:InvokeWorkflowFile ContinueOnError="{x:Null}" DisplayName="Invoke Send_email_With_Screenshot workflow" sap:VirtualizedContainerService.HintSize="484,112" sap2010:WorkflowViewState.IdRef="InvokeWorkflowFile_1" UnSafe="False" WorkflowFileName="Send_email_With_Screenshot.xaml">
<ui:InvokeWorkflowFile.Arguments>
<InArgument x:TypeArguments="x:String" x:Key="in_attachmentPath">
<mva:VisualBasicValue x:TypeArguments="x:String" ExpressionText="strAttachmentPath" />
</InArgument>
</ui:InvokeWorkflowFile.Arguments>
</ui:InvokeWorkflowFile>
</Sequence>
</Activity>