Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Deleting all handouts from player journals?

Is there a way to automatically delete all the handouts from the player Journals? I don't want to delete the entry itself but only from the players journals, in specific entries shared with all players. I know it can be done manually through edit but I am asking in case it can be automated.
1604230106
Oosh
Sheet Author
API Scripter
Not that I know of - as you're Pro though, an API script could do it. Provided you want to apply it to EVERYTHING it looks like a straight-forward script.
I just upgraded and don't really know how to use API but I will look into it, thank you.
1604231888

Edited 1690263413
Oosh
Sheet Author
API Scripter
Using them is pretty straight-forward - go to "API Scripts" in your game settings, and paste the below script into a new script tab. This is quickly thrown together, and has no real error checking or command lines that do anything else. You basically add this script, click Save, then wait for the message "removeHandout bot is ready" to come up in the API Console window (just below where you pasted the script). Then go into the game in another tab, and type !handoutRemove into chat. This will remove ALL content from the "inplayerjournals" property of ALL handouts - just double checking that's what you want to do. Or it might end the universe. If you wanted to get fancy with filters and keywords, that's possible, but is significantly more complicated. Might need someone with proper skills if that's the case. I'd probably disable or delete this once you're done with it - it's unlikely that someone will type !removeHandouts in to chat, but you never know.... there's no GM check or anything on this. Edit - code below fixed by Aaron on('ready', () => { log(`removeHandout bot is ready...`); on('chat:message', (msg) => { if (msg.type === 'api' && /^!handoutRemove/i.test(msg.content) ) { let counter=0; let handoutArray = findObjs({type: 'handout'}); log(`${handoutArray.length} handouts found...`); const burndown = () => { let h = handoutArray.shift(); if(h){ h.set('inplayerjournals',''); log(`${h.get('name')} removed from players' Journals...`); counter++; setTimeout(burndown,0); } else { sendChat('handoutBot',`${counter} handouts processed.`); } }; burndown(); } }); });
1604232307

Edited 1604232932
 This will remove ALL content from the "inplayerjournals" property of ALL handouts Yes, that's what I want to do. It worked, thank you very much.
1604242406
Oosh
Sheet Author
API Scripter
No problem, glad it didn't end the universe.