Google Photos - Clear album

Hi,

I created an automation which downloads pictures from a google photos album. The process is semi automated because I want to empty the album after I downloaded all pictures. For that part I have to work manually since I cannot clear the album via automated tasks.

Problems:
A) There is no dedicated function in G Photos to clear the whole album.
B) There could be some kind of approach to select all pictures manully. I need to select the first picture and scroll to the end of the album and select the last picture while holding shift key. Then I can go through the menu points to clear the album. But I did not find reliable selectors especially for the selection of the last picture.

One consideration was to just delete the album and recreate it (that would probably the most simple way) but the issue is that I have granted permissions to a bot user so I have shared the album to other user.
It won’t work to always add the user to the newly created album.

It bugs me that I cannot automate this last part of the automation.

Any advices on that issue?

Thanks and BR

@SenorChang

you can do click and scroll

use send hotkeys with shift key down onlt

[d(shift)]

then use mouse scroll with distance or element as you need and scroll till you need..can be extra scrolls also if you dont know how much to scroll

then use click to click on last photo ..

then send hotkey again and use U instead of d to take off shift

this selects all

cheers

Better use Google Photos API It allows deleting media items even if UI does not allow “clear album.” List all mediaItemIds in the album via API then Call mediaItems.batchDeleteso it deletes only the itemsthe album and sharing permissions stay same

Can you explain further? Maybe have an example? I don’t find a package for google photos.

The problem is that I can scroll to the end but I cannot dynamically find the last item selector wise. There is no such index in the selector which I could use to identify the last element (not even mentioning how I could get the amount of elements in the album).

@SenorChang

did you try find children and then get the last item from the output

cheers

Here is the output of find children activity. I don’t see anything useful here, do you?

[
{
“Selector”: {
“UseOmit”: true,
“Text”: “”,
“ParentSelector”: null
},
“ClippingRegion”: null,
“ClippingRegion_Normalized”: null,
“ImageBase64”: “”,
“Timeout”: 30000,
“WaitForReadyLevel”: “INTERACTIVE”,
“Attributes”: [
“AppPath”,
“PID”,
“TID”,
“aaname”,
“app”,
“aria-label”,
“aria-role”,
“class”,
“cls”,
“cookie”,
“css-selector”,
“foreground”,
“hasFocus”,
“height”,
“hwnd”,
“innerhtml”,
“innertext”,
“isMDIChild”,
“isleaf”,
“mobiledata”,
“outerhtml”,
“outertext”,
“parentclass”,
“parentid”,
“parentname”,
“position”,
“readystate”,
“subsystem”,
“tag”,
“UiPath-html-title”,
“viewBox”,
“visibility”,
“visibleInnerText”,
“visibleinnertext”,
“width”,
“wndExtStyles”,
“wndStyles”
],
“Activate”: true,
“AlterIfDisabled”: true,
“ScaleFactor”: 1.5,
“AppZoomFactor”: 1.0,
“DisplayDpiScaleFactor”: 1.5,
“UseNonBlockingInput”: false,
“SelectorStrategy”: “DEFAULT”,
“options”: “DEFAULT”
},
{
“Selector”: {
“UseOmit”: true,
“Text”: “”,
“ParentSelector”: null
},
“ClippingRegion”: null,
“ClippingRegion_Normalized”: null,
“ImageBase64”: “”,
“Timeout”: 30000,
“WaitForReadyLevel”: “INTERACTIVE”,
“Attributes”: [
“AppPath”,
“PID”,
“TID”,
“aaname”,
“app”,
“aria-label”,
“aria-role”,
“class”,
“cls”,
“cookie”,
“css-selector”,
“foreground”,
“hasFocus”,
“height”,
“hwnd”,
“innerhtml”,
“innertext”,
“isMDIChild”,
“isleaf”,
“mobiledata”,
“outerhtml”,
“outertext”,
“parentclass”,
“parentid”,
“parentname”,
“position”,
“readystate”,
“subsystem”,
“tag”,
“UiPath-html-title”,
“viewBox”,
“visibility”,
“visibleInnerText”,
“visibleinnertext”,
“width”,
“wndExtStyles”,
“wndStyles”
],
“Activate”: true,
“AlterIfDisabled”: true,
“ScaleFactor”: 1.5,
“AppZoomFactor”: 1.0,
“DisplayDpiScaleFactor”: 1.5,
“UseNonBlockingInput”: false,
“SelectorStrategy”: “DEFAULT”,
“options”: “DEFAULT”
},
{
“Selector”: {
“UseOmit”: true,
“Text”: “”,
“ParentSelector”: null
},
“ClippingRegion”: null,
“ClippingRegion_Normalized”: null,
“ImageBase64”: “iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAO1SURBVFhH7ddNbxtFHMfx3nkN0NwqcekBxBuAA2cuHFqJ+NgU7ohCK6S2NHFc2/HDPs3O7sw+ete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HBiRwJaj465ZWx50/PQEgaPD5zpaLsO9yMdeEqMXBYilC8EMsGYdvNlAyG2E0oVjW2B6c/he6gl06RSGHkLPhQwEWCRR9TgqrIk/AcQHycFqYD4lAAAAAElFTkSuQmCC”,
“Timeout”: 30000,
“WaitForReadyLevel”: “INTERACTIVE”,
“Attributes”: [
“AppPath”,
“PID”,
“TID”,
“aaname”,
“app”,
“aria-label”,
“aria-role”,
“class”,
“cls”,
“cookie”,
“css-selector”,
“foreground”,
“hasFocus”,
“height”,
“hwnd”,
“innerhtml”,
“innertext”,
“isMDIChild”,
“isleaf”,
“mobiledata”,
“outerhtml”,
“outertext”,
“parentclass”,
“parentid”,
“parentname”,
“position”,
“readystate”,
“subsystem”,
“tag”,
“UiPath-html-title”,
“viewBox”,
“visibility”,
“visibleInnerText”,
“visibleinnertext”,
“width”,
“wndExtStyles”,
“wndStyles”
],
“Activate”: true,
“AlterIfDisabled”: true,
“ScaleFactor”: 1.5,
“AppZoomFactor”: 1.0,
“DisplayDpiScaleFactor”: 1.5,
“UseNonBlockingInput”: false,
“SelectorStrategy”: “DEFAULT”,
“options”: “DEFAULT”
},
{
“Selector”: {
“UseOmit”: true,
“Text”: “”,
“ParentSelector”: null
},
“ClippingRegion”: null,
“ClippingRegion_Normalized”: null,
“ImageBase64”: “iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAO1SURBVFhH7ddNbxtFHMfx3nkN0NwqcekBxBuAA2cuHFqJ+NgU7ohCK6S2NHFc2/HDPs3O7sw+eteWnZIUEvVQtakEdhO4wAGQeLggEELigsTph/5GFvH4aZ01ggOWvrJke2c+np31yud++vV3/Jc6p77wb/c/aFFnAh1//Rve8X7Ay+99hQsbX+CZ1z8fPlP02huVb3Hvk18mjsvSUiBC0ORZIyAdo44zr0wg+rbqZMu0DGwhaNlVmVcW1FwQ7Qd10LzR/lLnyQRa5cqozVupqaC8eyZLjf0fJ+adCRpdyqvq1fe/wXc//4ELV/8el+ZQ550KIrk6YJ4IM3p8T6hTX3baqZsArXJ1TmPoQat0+v1pqzQGWuXqLMKMus0f4ODhQzwe9PHgyeNxEF2S6gFnKSuGeu3afchWhHR/F+l+bxy0it+dZTDUxStHsDwBHvkIeuk4aNr+ef7NL4eD0kTqe2rLYqjnCgMY0kHdscBiMQ5SP0yY04PPQ50FQxFIFxx1bsKO3MUgGngR6qyYUU1uQXMYvMTPfspmofJinl3vo26bMKWDqB1m29SzUHkx1MWNI2iuDSfwEKXBOGjeDXUaKi+GeuXtRxBpjCBtIWjJcdCim6qKyouhbopDJHu7aPU6EOqmnrax1VRUHgzVPtxD/GEXYSeBIcxJUJbbxwiVF/PWziFktwUrkDAdjopWnQTRP4ppV5saodTXlul8YQC/G4PFEjuWgXKtjmK1OAnKukp5u1HrQLQkTN9B1dCwWSphq7w5HUTNu+Lydvndj+BwHaZrQnNMVPUm7pS28cH2rdmgfwr10sYRUmHDthqo6TuoGDWU9TpKjRrulG7PB60aVbh+gIMkQjeUcB0TdbOOMsWaKNs6irWtxSCKfp+ybPRZnV/v41aljftJjI87CXaTCGHowvYYNN9GzWPYtjWUtLvZQNTo/7w62bzWCgNcunGIJPLRiQP04gC7rRBpKCGlDUtYMEIHzdhF0dWx1djODhr1dHCMesPBpWt7eOHKI6ytf/rX5Ot9rBX6ePHqE1y+foCb5TbaUiIJfcSRj9AXCAUfYmKPw2YamlYDumdDiwWKroHNRml50MnJZ0ikhcS1kHILbYehIzgSwRG5NnzOIC0TPqPPOGgFHqTgYKYGbmpoh3KY7zIw2wDzHBiRwJaj465ZWx50/PQEgaPD5zpaLsO9yMdeEqMXBYilC8EMsGYdvNlAyG2E0oVjW2B6c/he6gl06RSGHkLPhQwEWCRR9TgqrIk/AcQHycFqYD4lAAAAAElFTkSuQmCC”,
“Timeout”: 30000,
“WaitForReadyLevel”: “INTERACTIVE”,
“Attributes”: [
“AppPath”,
“PID”,
“TID”,
“aaname”,
“app”,
“aria-label”,
“aria-role”,
“class”,
“cls”,
“cookie”,
“css-selector”,
“foreground”,
“hasFocus”,
“height”,
“hwnd”,
“innerhtml”,
“innertext”,
“isMDIChild”,
“isleaf”,
“mobiledata”,
“outerhtml”,
“outertext”,
“parentclass”,
“parentid”,
“parentname”,
“position”,
“readystate”,
“subsystem”,
“tag”,
“UiPath-html-title”,
“viewBox”,
“visibility”,
“visibleInnerText”,
“visibleinnertext”,
“width”,
“wndExtStyles”,
“wndStyles”
],
“Activate”: true,
“AlterIfDisabled”: true,
“ScaleFactor”: 1.5,
“AppZoomFactor”: 1.0,
“DisplayDpiScaleFactor”: 1.5,
“UseNonBlockingInput”: false,
“SelectorStrategy”: “DEFAULT”,
“options”: “DEFAULT”
}
]

@SenorChang

Not sure on what you have done find children and what filter you used

let me help you

first indicate the box which contains all photos in it

now use a filter which filters only for photos may be like <webctrl tag='img' /> - this is an example you need to find the filter to be used for filtering only photo items ..then you can get the last children

cheers

Hi Anil,

Thanks for your response. I managed to find a solution for the issue. I did a similar approach as you suggested but without identifying children or any background stuff.

Works like a charm so far. Thank you.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.