Editing a Profile

If you need to change the way you configured a profile, you can edit the profile in the Profile Creation wizard. If you need to make advanced edits not available in the wizard, you can edit the profile's XML directly.

Basic Profile Editing

  1. Select the profile in the Laserfiche Connector Configuration dialog box.
  2. Click Edit to open the Profile Creation wizard.
  3. Note: If the Profile Creation wizard doesn't recognize the profile, it will open the XML directly in Notepad. The wizard may not recognize the profile if its XML has already been edited to include advanced features not included in the wizard.

  4. Use the Profile Creation wizard to change the way the profile is configured. You may need to re-select applications and tokens as you progress through the wizard.
  5. Tip: You can change the keyboard shortcut for the profile by clicking the Shortcut button in the Laserfiche Connector Configuration dialog box.

  6. Optional: To edit advanced options in a profile's XML directly, see Finding the XML Profile and then Editing the XML Profile.

Finding the XML Profile

Advanced options that aren't available in the Profile Creation wizard, can be configured directly in the XML profile. These profiles can be accessed in the following locations:

Tip: To see where a specific profile is stored, check the Location column for the profile in the Laserfiche Connector Configuration dialog box.

XML Schema file: Laserfiche Connector also comes with an XML schema file that details the different parts of the XML profiles. The XML Schema file is located here: <installation directory>\Laserfiche\LFConnector on the computer on which the Laserfiche Connector Profile Creator was installed.

Editing the XML Profile

Once you open the XML profile, you can update the following features. In Laserfiche Connector version 10.2, the schema version changed to 2.0.

<Profile xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaversion="2.0">

Button Properties

From the Profile Creation wizard, you can drag the Laserfiche Connector button to a spot in a target application and you can use the button size slider to resize it. However, if you want to precisely define the button's location and size, edit the XML directly.

In the <AppDef> element, add the following attributes:

Example: This XML syntax places the Laserfiche Connector button 180 pixels left of the right edge of the title bar and 5 pixels from the top. It also gives it a width of 40 pixels and a height of 40 pixels. Additionally, users can move the button by right-clicking it and dragging it to a new position.

<AppDef woffset="-180,5,40,40" enabledrag="true" showicon="true" url="http://msn.com.*" wclass="MozillaWindowsClass" pname="firefox">

Combining Actions

You can combine two Laserfiche Connector actions in a single profile by combining elements from two separate XML profiles.

Example: You want your profile to open a website and then take a screenshot of that website. To accomplish these actions, create two profiles with the Profile Creation wizard, one that opens the website and another that takes a screenshot of that website. Open the "take screenshot" profile's XML file and locate the <AppDef> element. Copy that element to the "open website" profile and increase the value of the order attribute so that it is the last one in the <Apps> element. Then, check the following:

  1. Update the <FlowDef> ID to avoid errors from having duplicate flows.
  2. Update the manuallyrun attribute of <FlowDef> to specify if you want the action to run automatically or not.
  3. Clean up any duplicate steps. For example, LoadSystemTokens appears multiple times, so you can delete the duplicates.
  4. Check the window title, window URL, and button location.

Default Value for a Control

You can specify a default value that will be used if a control is blank when the Laserfiche Connector profile runs.

In the control's element, add the attribute "DefaultValue" and give it a value.

<StepDef type="ReadControl">

<Attributes />

<Elements>

<Element name="%(Content)">

<Attributes>

<Attribute name="Condition" value="/Root[1]/Edit[1]" />

<Attribute name="Property" value="Value" />

<Attribute name="DefaultValue" value="100" />

</Attributes>

<Children />

</Element>

</Elements>

</StepDef>

Field Types and Formatting Date and Time Tokens

By default, if there's no data type specified, Laserfiche Connector treats all the token values as strings. If you specify a data type for a token, then you can apply custom ICU formatting to the value. ICU formatting for dates and times or ICU formatting for numbers.

There are six data types you can specify as token attributes in addition to the default string type: Date, Time, DateTime, Integer, Long, and Number. These data types are case sensitive, and Laserfiche Connector will ignore data types that are not capitalized correctly.

Example: A date token returns the value "9/7/2014," but you want this to be interpreted as July 9, 2014. You can accomplish this by specifying the DateTime data type and applying this pattern: "d/M/yyyy."

Note: If you do not specify the data type first, Laserfiche Connector will ignore the pattern.

To define the data type and pattern, add the Type and Pattern attribute elements for the token, as shown below:

<StepDef type="ReadControl">

<Attributes/>

<Elements>

<Element name="%(DateTime)">

<Attributes>

<Attribute name="Condition" value="//*[@AutomationId="tbxContactFirst"]"/>

<Attribute name="Property" value="Value"/>

<Attribute name="Type" value="DateTime"/>

<Attribute name="Pattern" value="yyyy-MM-dd hh:mm:ss a"/>

</Attributes>

<Children/>

</Element>

Additionally, you can format the value of the token wherever you use the token. To apply formatting, use the syntax: %(tokenName;format).

<Attribute name="LFFolderPath" value="\Memos\%(DateTimeToken;MM_dd_yyyy)"/>

Ignoring the "Cannot Read Value of Specified Control" Error

Sometimes Laserfiche Connector may not be able to read the value of a specific control (e.g., a field or other item in the target application), causing this error to occur and interrupt Laserfiche Connector's action. You can configure the profile to always ignore this error for a specific control and to record an empty value for the control.

To ignore the error for a specific control, locate the control’s token element and set the IgnoreError attribute to true. If this option is not specified for a control, Laserfiche Connector will treat it as false and will not ignore the error.

Example:

<Element name="%(CompanyName)">

<Attributes>

<Attribute name="Condition" value="/Root[1]/Custom[1]/Custom[2]/Custom[1]/List[1]/ListItem[2]/Custom[1]/Edit[1]"/>

<Attribute name="Property" value="Value"/>

<Attribute name="IgnoreError" value="true"/>

</Attributes>

<Children></Children>

</Element>

Import Document Settings

If your profile imports a document, the following attribute values can be edited in the <StepDef type="ActionName"> element:

For importing into the currently open Laserfiche document

<StepDef type="ImportCurrentDoc">

<Attributes>

<Attribute name="AssignTemplateMode" value="2" />

<Attribute name="NewTemplate" value="General" />

<Attribute name="RemoveOldFields" value="true" />

<Attribute name="Overwrite" value="true" />

<Attribute name="SaveAsNewVersion" value="true" />

</Attributes>

For importing into the Laserfiche Windows client

Example:

<StepDef type="ImportDoc">

<Attributes>

<Attribute name="LFServer" value="myserver.com" />

<Attribute name="LFPort" value="0" />

<Attribute name="LFRepository" value="MyRepo" />

<Attribute name="WindowsAuth" value="True" />

<Attribute name="UseSSL" value="True" />

<Attribute name="LFFolderPath" value="\Human Resources\Employees\%(NewEmployeeName)" />

<Attribute name="LFDocumentName" value="%(FileName)" />

<Attribute name="LFTemplate" value="Employee Info" />

<Attribute name="LFVolume" value="HumanResources" />

<Attribute name="RetainEdocFileExtension" value="true" />

<Attribute name="ExtractEdocText" value="true" />

<Attribute name="GeneratePdfPages" value="true" />

<Attribute name="KeepPDFFile" value="true" />

<Attribute name="ConvertPdfAnnotation" value="true" />

<Attribute name="PdfImportMonochrome" value="true" />

<Attribute name="PdfImportResolution" value="300" />

</Attributes>

<Elements>

Tip: The %(FilePath) token is the full path of the imported document, which you might want to save in a field. The %(FileName) token will be replaced by the document's original name. You can use this as the LFDocumentName attribute so the document keeps its name, or you could store this value in a field if you want to record the document's original name. If you define tokens with the same names as these tokens, they will still be replaced by the full path and document name (and not the values you define).

OCR Image Enhancement and Language Settings

If analyzing a window with OCR is not returning the results you want, configure the language and image enhancement settings in the XML profile to optimize OCR accuracy.

Language

By default, the OCR language is set to English, which means the OCR engine is optimized to return English words. If the windows you are OCRing are in a different language, follow the steps below to change the language.

Image Enhancements

The following is a list of some of the more useful the XML elements that can be updated to change the image enhancement settings. Image enhancements are applied during OCR to improve OCR accuracy. None of these enhancements affect the actual image.

Recommendations

Scanning

When using the scanning action, you can configure an attribute to determine if Laserfiche Connector will wait for Laserfiche Scanning to finish.

Note: The scanning action has the following limitations:

  • WaitScanExit

    Note: This option is only available when scanning into the Laserfiche Windows client or into the currently open Laserfiche document.

  • Example: For the Scan into currently open Laserfiche document option:

    <StepDef type="OpenDocScanning">

    <Attributes>

    <Attribute name="ScanMode" value="Standard" />

    <Attribute name="AssignTemplateMode" value="2" />

    <Attribute name="NewTemplate" value="demo" />

    <Attribute name="RemoveOldFields" value="true" />

    <Attribute name="WaitScanExit" value="true" />

    </Attributes>

    Screenshot

    If you want to change how Laserfiche Connector takes a screenshot of an application or website, find the <StepDef type="TakeScreenshot"> step and configure the following attributes.

    In the <StepDef type="ImportScreenshot"> step, you can configure how the screenshot is imported and some broad import settings. More specific import settings are inherited from other import elements in the profile. See the Import Document Settings section below for more options for configuring imported documents.

    Example: The Accounting Department needs a screenshot of the center column of their account tracking website whenever they edit a billing statement in the Laserfiche Windows client. The profile below lets them capture the center column of the website, even if it extends past the initially visible portion of the page. The resulting screenshot will be saved in the document currently open in the Laserfiche Windows client (i.e., the billing statement they are editing). If the screenshot extends beyond 2050 pixels in length, it will be split into multiple pages. The document's original template is retained and the current date is added to the Date field.

    <StepDef type="TakeScreenshot">

    <Attributes>

    <Attribute name="CaptureMode" value="ScrollRegion" />

    <Attribute name="ImageHeightOfEachPage" value="2050" />

    <Attribute name="SeparateIntoLFPages" value="true" />

    <Attribute name="CaptureInterval" value="200" />

    </Attributes>

    <Elements />

    </StepDef>

     

    <StepDef type="ImportScreenshot">

    <Attributes>

    <Attribute name="AssignTemplateMode" value="0" />

    <Attribute name="TakeAction" value="ImportCurrentDoc" />

    <Attribute name="Overwrite" value="false" />

    <Attribute name="SaveAsNewVersion" value="true" />

    </Attributes>

    <Elements>

    <Element name="LFFieldMapping">

    <Attributes>

    <Attribute name="LFField" value="Date" />

    <Attribute name="LFValue" value="%(Date)" />

    <Attribute name="AssignFieldMode" value="1" />

    </Attributes>

    <Children />

    </Element>

    </Elements>

    </StepDef>

    Note: The ImportScreenshot step must be after any ReadControl steps in the profile so that ImportScreenshot can make use of tokens defined in the ReadControl step. Additionally, if you are retrieving values from multiple applications, the TakeScreenshot step will reference the initial target application, by default. However, you can reference a different application by moving the <StepDef type="TakeScreenshot"> into the appropriate <AppDef> element. The ImportScreenshot step can use tokens from any previous applications configured in the profile.

    Search Automatically and Show the Search Count

    If you've configured Laserfiche Connector to automatically run a search and display the search count next to the Laserfiche Connector button, you can configure the timeout period after which the search will be canceled if it hasn't yet completed.

    <Flows>

    <FlowDef id="6777c3e1-bee1-44cf-bc68-f1d1314e3938" name="Search the Laserfiche Windows client" preferweb="true" background="true">

    ....

    <StepDef type="OpenLFClient">

    <Attributes>

    <Attribute name="LFServer" value="localhost" />

    <Attribute name="LFPort" value="0" />

    <Attribute name="LFRepository" value="MyRepo" />

    <Attribute name="WindowsAuth" value="false" />

    <Attribute name="LFQuery" value="({LF:Basic~="%(Edit)",option="DFNA"}) & {LF:Name="*", Type="D"}" />

    <Attribute name="Timeout" value="10000" />

    </Attributes>

    <Elements />

    </StepDef>

    Search Display Options

    When you've configured Laserfiche Connector to run a search in the Laserfiche Windows client, you can configure the following options:

    <StepDef type="OpenLFClient">

    <Attributes>

    <Attribute name="LFServer" value="localhost"/>

    <Attribute name="LFPort" value="0"/>

    <Attribute name="LFRepository" value="MyRepository"/>

    <Attribute name="WindowsAuth" value="False"/>

    <Attribute name="LFQuery" value="{LF:Basic~="%(Edit)",option="DFNA"}"/>

    <Attribute name="ShowInNewWindow" value="true"/>

    <Attribute name="OpenIfOneResult" value="false"/>

    <Attribute name="ShowSearchPane" value="true"/>

    </Attributes>

    <Elements/>

    </StepDef>

    Targeting Dynamic Controls with UI automation

    If you're using UI automation to select controls in an application or website, it can be hard to select controls that only show when certain conditions are met. (E.g., The "Overdue Cases" field only appears on the website when there are overdue cases.) To gather information from controls that are not always available, edit the XML to locate the controls based on stable attributes such as the control's name.

    Find a control's name

    1. Enable tracing.
      1. Right-click the Laserfiche Connectoricon in the notification section of the taskbar, and select About Laserfiche Connector.
      2. Click Tracing.
      3. Select Enable tracing and specify where the logs will be saved.
    2. Restart Laserfiche Connector.
    3. Create a new profile, and select Use UI Automation to find controls as the method of analyzing the window or website.
    4. Drag the target to the target window or website.
    5. Click Next to analyze the window or website.
    6. Check the trace log, located here by default: %AppData%\Roaming\Laserfiche\Connector\logs. Open the XML file named LFControlInformation_xxxxxx. In the XML file, find the control you want to get the name for. It should be a XML node like the following:
    7. <DataItem Digest="Account Name" Name="" Id="42,7148524,2,179">

      <Edit AutomationId="acc2" Digest="Account Name" Name="Account Name" VV="" Id="42,7148524,2,20" />

      </DataItem>

    Update the XML with the control's name

    1. After the profile has been created, open its XML file.
    2. Find the element for the token associated with the control.
    3. Edit the Condition attribute with XPath so that it points to the control's name instead of to a relative path.
    4. Example:

      Change

      <Attribute name="Condition" value="/Root[1]/Pane[1]/Window[1]/Pane[1]/Tree[1]" />

      to

      <Attribute name="Condition" value="//Edit[@Name='ControlName']" />

    Fields for the Assign Templates and Fields Action

    The Assign Templates and Fields action allows for a lot of flexibility in how templates and fields are applied. The following XML attributes govern how multi-value fields will be handled:

    Field attributes

    Example: The following XML removes the current template but keeps the fields from the template. For the Contacts multi-value field, existing values are replaced with values gathered from the third-party application.

    <StepDef type="AssignField">

    <Attributes>

    <Attribute name="LFServer" value="myserver.com" />

    <Attribute name="LFPort" value="0" />

    <Attribute name="LFRepository" value="MyRepo" />

    <Attribute name="WindowsAuth" value="True" />

    <Attribute name="LFQuery" value="{LF:Basic~="%(search)",option="DFNALT"}" />

    <Attribute name="AssignTemplateMode" value="1" />

    <Attribute name="RemoveOldFields" value="false" />

    </Attributes>

    <Elements>

    <Element name="LFFieldMapping">

    <Attributes>

    <Attribute name="LFField" value="Contacts" />

    <Attribute name="LFValue" value="%(FirstContacts)" />

    <Attribute name="AssignFieldMode" value="0" />

    </Attributes>

    <Children />

    </Element>

    <Element name="LFFieldMapping">

    <Attributes>

    <Attribute name="LFField" value="Contacts" />

    <Attribute name="LFValue" value="%(SecondContacts)" />

    <Attribute name="AssignFieldMode" value="0" />

    </Attributes>

    <Children />

    </Element>

    </Elements>

    </StepDef>

    Token String Functions

    Laserfiche Connector provides the string functions SPLIT, SUBSTRING, and TRIM to let you modify token strings.

    Each function can be defined in a <Child> element in the XML file. To use a combination of these functions, you can add multiple Child elements for a single token <Element> element. Functions will run in the order in which they appear in the XML.

    Example: With the following XML, you can split a string at a space (delimiter " "), save it as an array, and then return the second string in this array.

    <Element name="%(Name)">

    <Attributes>

    <Attribute name="Condition" value="//*[@AutomationId="1001"]"/>

    <Attribute name="Property" value="Label"/>

    </Attributes>

    <Children>

    <Child name="SPLIT">

    <Attributes>

    <Attribute name="Delimiters" value=" "/>

    <Attribute name="IndexToReturn" value="2"/>

    </Attributes>

    </Child>

    </Children>

    </Element>

    Example: With the following XML, you can get a sub-string that starts with the string's second character and continues for a length of 10 characters.

    <Element name="%(Name)">

    <Attributes>

    <Attribute name="Condition" value="//*[@AutomationId="1001"]"/>

    <Attribute name="Property" value="Label"/>

    </Attributes>

    <Children>

    <Child name="SUBSTRING">

    <Attributes>

    <Attribute name="Start" value="2"/>

    <Attribute name="Length" value="10"/>

    </Attributes>

    </Child>

    </Children>

    </Element>

    Example: In the following XML, the TRIM function removes leading and/or trailing white spaces from a string.

    <Element name="%(Name)">

    <Attributes>

    <Attribute name="Condition" value="//*[@AutomationId="1001"]"/>

    <Attribute name="Property" value="Label"/>

    </Attributes>

    <Children>

    <Child name="TRIM">

    </Child>

    </Children>