// TARGET:"C:\Program Files\ArcGIS\Pro\bin\ArcGISPro.exe" // START_IN:"C:\Program Files\ArcGIS\Pro\bin\" using LoginPI.Engine.ScriptBase; public class ArcGISPro : ScriptBase { void Execute() { /* DISCLAIMER: This workload is provided as-is and might need further configuration and customization to work successfully in each unique environment. For further Professional Services-based customization please consult with the Login VSI Support and Services team. Steps: - Open ArcGIS - Open Project (specified by mapTitle variable on line 24) - Search for Location (specified by locationToSearch variable on line 27) - Save file - Close ArcGIS This script was developed against ArcGIS Pro Edition, version 3.1 on 3/8/2023 Author: Nick Campa (n.campa@loginvsi.com) */ var shortTimeout = 15; var longTimeout = 30; // This is the name of the project map to select and open var mapTitle = ""; // This is the location that will be searched within the target project var locationToSearch = ""; START(mainWindowTitle: "ArcGIS Pro", processName: "ArcGISPro"); Wait(3); // Select the target map TakeScreenshot("ArcGIS_Successful_Start"); var mapBtn = MainWindow.FindControl(className : "ListItem:ListBoxItem", title : mapTitle); mapBtn.Click(); // Start timer to load map once we select it StartTimer("Load_Map"); // Find new map window var mapWindow = FindWindow(title: mapTitle); // Wait for Map to load before searching it, once the scale factor text appears, it has loaded so we can stop the timer mapWindow.FindControl(className : "Edit:TextBox", text : "1:*", timeout: shortTimeout, continueOnError: true); StopTimer("Load_Map"); // Screenshot Map Load TakeScreenshot("Loaded_Map"); Wait(5); // Get the Location button to open the pane var locateBtn = mapWindow.FindControlWithXPath(xPath : "MenuBar:Ribbon/Tab:TabStrip/TabItem:Tab/Group:RibbonGroup[4]/Pane:StackPanel/SplitButton:SplitButton[1]/Image:Image", timeout: longTimeout); Wait(1); locateBtn.Click(); Wait(5); // Search for location as specified in variable locationToSearch Type(locationToSearch + "{ENTER}", cpm: 250); StartTimer("Search_Location"); // Look for map scale to determine Location search load mapWindow.FindControl(className : "Edit:TextBox", text : "1:*", timeout: longTimeout); StopTimer("Search_Location"); // Take screenshot of searched location TakeScreenshot("Load_Location_Search"); // Use shortcuts to save file, bypass dialogue screen Type("{CTRL+S}"); Wait(1); Type("{ENTER}"); // Close ArcGIS STOP(); } }