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 / Open 1 file image at a...
Power Automate
Unanswered

Open 1 file image at a time

(0) ShareShare
ReportReport
Posted on by 141

Hi, 

 

Wondering if there is a way to open one image file at a time other then 'send key' commands, then close the image after a screenshot is taken.

 

I do have a way already made that finds a txt file name if it exist - if yes it clicks the file then, down arrow, return to open, close and repeat for all files in For each, but wondering if there is a more efficient way to do this. 

 

Appreciate any help, thanks!

 

I have the same question (0)
  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    You can open image by using "Run application" and calling mspaint.exe followed by the image path.

    Then once you are done with whatever you want to do, use UI automation to close the Pain app and go to next file

     

    You can to the same with notepad and txt files, if you want to open the file. But if you just want to get content of the text file into variable then use "Read text from file" action

  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    Hi @jkingno1 ,

     

    Here is a solution:

    Kaif_Siddique_0-1677699512880.png

     

    Copy and Paste to PAD

    Folder.GetFiles Folder: $'''D:\\Sample Files''' FileFilter: $'''*.txt''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
    LOOP FOREACH CurrentItem IN Files
    System.RunApplication.RunApplicationAndWaitToLoad ApplicationPath: CurrentItem WindowStyle: System.ProcessWindowStyle.Maximized Timeout: 0 ProcessId=> AppProcessId WindowHandle=> WindowHandle
    WAIT 1
    Workstation.TakeScreenshot.TakeScreenshotOfPrimaryScreenAndSaveToFile File: $'''D:\\Sample Files\\%CurrentItem.NameWithoutExtension%.png''' ImageFormat: System.ImageFormat.Png
    System.TerminateProcess.TerminateProcessById ProcessId: AppProcessId
    END

     

    If I have answered your question, please mark my post as Solved.

    If you like my response, please give it a Thumbs Up.

     

    Regards

    Kaif

  • jkingno1 Profile Picture
    141 on at

    Could you explain what u mean by 'followed by the image path'? I've got this atm. But Paint always says it cant find the image 

    jkingno1_0-1677825444692.png

     

  • jkingno1 Profile Picture
    141 on at

    This half works but I had to make some adjustments to only open Images (jpg) as I don't need to open txt files. And also the terminate process doesn't work for me and instead I used a mouse location click on the close image position. 

    jkingno1_1-1677825688139.png

     

  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    Update File Filter to "*.jpg"

     

    File Filter allows wild cards, for example, *.txt or document? .doc. To allow for multiple file filters, separate the choices with a semi-colon, for example, .txt;.exe.

     

    Kaif_Siddique_0-1677878459962.png

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 269 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 184 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 136 Super User 2026 Season 2

Last 30 days Overall leaderboard