How can I retrieve the name of the current process from within a xaml?
We are trying to centralize the location of screenshot taken by the RE-Framework. So within the TakeScreenshot.xaml, we need to retrieve the process name so that the screenshots can be dropped into a folder named after the process itself.
Hi all, I’ve found a solution that I like a little better. You can use the command Process.GetCurrentProcess.MainWindowTitle
So long as your project name matches the name of the folder that it’s contained in (I sort of like that it encourages making these match).
This method also has the added advantage of providing the name of the Orchestrator environment that the job was run in. Unfortunately, I can’t find any other way to get the version, though, so if you need that the other method will be the way to go.
Be careful with MainWindowTitle. Depending upon what the automation is doing, the title can change. I just ran into an issue where the title changed to “Connection: servername” because I was connected to a mainframe.
We just updated to Studio Version 2022.4.3 and found that the name found now appends the Environment name from Orchestrator. So previously we got “Some_Process” and now it returns “Some_Process_Production” where Production is the name of our Environment. Yes, this is only for processes that do NOT run in the background. We’ve had to hard code those as I can’t find a way to get it dynamically.