Hi team,
Need help!
I'm able to save the screenshot by the name Ex - Amazon
Now, I would like to save those screenshots by folder
Ex - Flow must create a folder for all the screenshots with Amazon & create another folder for all the screenshots with Walmart
Feel free to ask for more details, if my explanation isn't clear.
Thank you in advance.
Hi
I have stumbled across a few of your screenshot issues by now. I hope you got it solved. For future reference and for others who might end up here, this demo might be of assistance:
Take screenshots and store them in folders - Power Automate Desktop
Best regards
Mathias Kjeldsen
Copy all the text below and paste it into you subflow. These are actual commands. You can change the variable names after you paste it. I am not at my computer to give you screenshots. Good luck:
SET DownloadFolder TO $'''Downloads'''
Folder.GetFiles Folder: DownloadFolder FileFilter: $'''*''' 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
Text.GetSubtext Text: CurrentItem CharacterPosition: 0 NumberOfChars: 6 Subtext=> Subtext
IF (Folder.DoesNotExist Path: $'''C:\\Screenshots\\%Subtext%''') THEN
# If C:\Screenshots doesn't exist, create it and set the new folder to 'DestinationFolder'
Folder.Create FolderPath: $'''C:\\Screenshots''' FolderName: Subtext Folder=> DestinationFolder
END
File.Move Files: CurrentItem Destination: DestinationFolder IfFileExists: File.IfExists.DoNothing MovedFiles=> MovedFiles
END
Thank you @MichaelAnnis
I will definitely put this In my flow & get back to you.
Could you please screenshot the demo for the latest solution?
Right, so, however it is named (if you gave me an example of a few, that would help), but my flow below would still work, you just might need to mess with how a screenshot name identifies to which folder it goes. If you have hundreds of websites, then I would skip the switch functionality and go straight to:
Get Files %AllScreenshots%
For each %CurrentItem% in %AllScreenshots%
Parse/Split/GetSubtext on %CurrentItem% to %DestinationFolderName%
If %DestinationPath%\%DestinationFolderName% doesn't exist
EndIF
Move %CurrentItem% to %DestinationPath%
End (For Each)
I don't name it manually but based on the website name the screenshot will be adapted. So, it's completely dynamic.
You name the screenshot when you take it, correct?
@MichaelAnnis
My screenshot names are not static, they're dynamic.
I take screenshots from hundreds of websites.
I take a screenshot from the Amazon website then a folder Amazon has to be created & move all the Amazon named screenshots into the folder.
Same applies for different screenshots & websites.
You can paste this into a subflow:
# Assuming all the screenshots are labeled ex. Amazon0001, Amazon0002, Walmart0001, etc. and saved to a specific folder (DownloadFolder). For my example, I will use the left 6 of the filenmae to determine the folder.
SET DownloadFolder TO $'''Downloads'''
Folder.GetFiles Folder: DownloadFolder FileFilter: $'''*''' 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
Text.GetSubtext Text: CurrentItem CharacterPosition: 0 NumberOfChars: 6 Subtext=> Subtext
# Here, if you can determine the Destination Folder from the subtext, then you can just go straight to Set Destination Folder as %DestinationPath%\%Subtext%. If not, then use the following Switch/Case scenario.
SWITCH Subtext
CASE = $'''Amazon'''
SET DestinationFolder TO $'''C:\\Screenshots\\Amazon'''
CASE = $'''Walmar'''
# Notice the "Walmar"; the "Get subtext" earlier only grabbed the left 6 characters.
SET DestinationFolder TO $'''C:\\Screenshots\\Walmart'''
DEFAULT
IF (Folder.DoesNotExist Path: $'''C:\\Screenshots\\%Subtext%''') THEN
# If C:\Screenshots doesn't exist, create it and set the new folder to 'DestinationFolder'
Folder.Create FolderPath: $'''C:\\Screenshots''' FolderName: Subtext Folder=> DestinationFolder
END
END
File.Move Files: CurrentItem Destination: DestinationFolder IfFileExists: File.IfExists.DoNothing MovedFiles=> MovedFiles
END
Thank you @MichaelAnnis!
For better understanding, can you post the images of the flow?
So, I am assuming the following:
I would design a process to put it in the right folder based on the name it contains. If you determined Amazon or Walmart earlier, you that logic and assign the %Store% variable to each picture. So it essentially looks like this:
get files from download folder
for each file
set the Store variable
Switch Store (you can skip the whole switch process if you can determine the folder name based off the store variable such as %DestinationPath%/%Store%, the you could just skip Switch/Case and go directly to move file)
Case Amazon
set destination folder to Amazon folder
Case Walmart
set destination folder for Walmart
(keep adding cases for all your different stores)
Case Else
If folder doesn’t exist
Create Folder
End If
Set destination folder (based off store name)
End switch
move file from download folder to destination folder
end loop
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional