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 .
×
The Roll20 Black Friday sale is live now! Up to 30% Off Your Favorite Content!

Quickly changing who am I speaking as.

I wish to be able to press Alt+1 to instantly change who I am speaking as to the sheet of the token I am selecting, and press Alt+2 to return to being my own self. Can this be done using a script, or preferably, a bookmarklet?
1793262152
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I don't know about keyboard commands, but it could be done with macro buttons. The Aaron wrote a short script to change Speaking As rapidly:  Switch Also, here is a macro by Jarren that does this without a Mod script.
I use the MOD Keithcurtis mentioned with a pair of macros; one is set up as a token action to change the speaker to the selected token and the other is a general macro in my macro bar to switch back. 
Not quite what you're after, but: Create a macro called "Speak-As" or whatever, with something like this for the content: /as "@{selected|character_name}" ?{Speech} Or "@{selected|token_name}" if you prefer. Then after you save it make sure the "Show As Token Action?" checkbox is checked. From then on when you have a token selected you can just click the "Speak-As" button to say something as that character.
1793314655

Edited 1793317879
I have kludged it together enough to work. First I set The Aaron's script linked above as one of my scripts. Then I make alphabetically the first and second token actions of all tokens respectively do "!switch @{selected|character_id}" and "!switch" Then I use the following bookmarklet: (I think it's also from The Aaron) javascript:(function(){ "use strict"; $('body').keydown(function(e) { var n,o,t; if( e && e.altKey && (48 <= e.keyCode) && (58 >= e.keyCode) ){ n=e.keyCode - ( 48===e.keyCode ? 38 : 49 ); o=$('#secondary-toolbar%20ul.mode.tokenactions');%20if(o%20&&%20'none'%20!==%20o.css('display'))%20{%20t=o.children()[0].children[n];%20if(t)%20{%20t.click();%20}%20}%20}%20});%20}()); All together it functions as intended, though a bit wonky setting it up, and ideally the bookmarklet could be switched to macro toolbar instead of token actions. But thank you all for the help.