Last active
March 7, 2024 22:01
-
-
Save Ed1123/d72e0d3fbd89cdd00ac63d1d74d0debe to your computer and use it in GitHub Desktop.
A script to auto-select the star emoji for all stickers when importing them to Signal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Delay function | |
const delay = ms => new Promise(res => setTimeout(res, ms)); | |
// Delay between clicks (seconds) | |
delayBetweenClicks = .1; | |
// Loop for all the stickers | |
stickers = document.getElementsByClassName('lCzvEVovrfFcZaKyf3ZOA'); | |
for (i=0; i<stickers.length; i++){ | |
// Clicking each emoji element for each sticker | |
stickers[i].getElementsByClassName('_2S1Fkez4JWbv9-1wbe5aeH')[0].click(); | |
// Waiting | |
await delay(delayBetweenClicks * 1000); | |
// Scrolling to make the star visible | |
document.querySelector("body > div:nth-child(8) > div > div > div:nth-child(1) > div").scrollBy(0, 4500); | |
// Waiting | |
await delay(delayBetweenClicks * 1000); | |
// Clicking the star emoji | |
document.querySelector('[title="star"]').click(); | |
// Waiting | |
await delay(delayBetweenClicks * 1000); | |
// logging | |
console.log(i); | |
} |
Oh, thanks! I wrote it a long time ago. Thanks for fixing it. 😄
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the version here didn't work for me so here's a version i ended up using