web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / UI automation loop pro...
Power Automate
Unanswered

UI automation loop problem

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

I am trying to resize a bunch of pdfs by printing them into a different size sheet, but I keep running into problems with the flow trying to focus on the print windows or sending keys or even just clicking on the file menu.

 

Everything runs fine on the first file, then on the 2nd file it can open and click on all the page setups to make sure the resize is right and Print to PDFs. After the flow click the print button, it has issues focusing on the Save As window and I have to create a subflow for PAD to be able to focus on that Save As window for the 2nd PDF. 

 

the first UI selector is like this: 

> window[Class="#32770"][Name="Save Print Output As"] > pane[Class="DUIViewWndClassName"] > combobox[Class="AppControlHost"][Id="FileNameControlHost"] > edit[Class="Edit"]

 

and the 2nd UI selector is this:

> window[Class="#32770"][Name="Save Print Output As"] > pane[Class="DUIViewWndClassName"] > pane[Class="DirectUIHWND"][Name="Explorer Pane"] > pane[Class="FloatNotifySink"]:eq(0) > combobox[Class="ComboBox"][Name="File name:"] > edit[Class="Edit"][Name="File name:"]

 

I am not sure why there is a different but I cannot figure out how to modify either 1 of the UI selector to make it work for multiple files.

 

Same thing when I try to close down the pdf file..... on the 2nd pdf file when I click on File > close, PAD was able to click on File to open the file menu, but it failed to close on Close PDF like on the 1st pdf file for some reason....

 

any idea how I can modify the UI selector to make it more "universal" ?

I have the same question (0)
  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    I'm sure someone has an answer to your UI problem, I just don't deal with them enough.  Adobe has very efficient hot keys {Alt}(f) for File, (p) for Print and so on.  If you don't find a solution, I would try using those as they are very reliable.  PAD is pretty fast, so I will typically put a Wait(1) between commands, give the windows time to pop up as you move through the menus and options.

    Best of luck!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I setup the flow with hot key in the beginning but it wasn't acting reliably. For example when I try to print, I had it setup with send key with Ctrl+O, but sometimes it would just sit there even with added wait time and I couldn't figure out why it had problem.

     

    It looks like PAD have issues focusing on the windows as they open for some reason

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Odd.  Wait times are good, and also {Control}(O) is read by send keys as actually {Control}({LShiftKey}(o)).  So just keep that in mind when using Send Keys, that you want {Control}(o) instead.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 253 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 172 Super User 2026 Season 2

#3
trice602 Profile Picture

trice602 134 Super User 2026 Season 2

Last 30 days Overall leaderboard