Hello there, I'm 100% certain that automaSetVariable does fail to fetch variable that are valid in the Javascript.
For example, here is some code below, that does show a working string variable text in the console, but Automa does not add/show the variable transcript.
yet text variable is just a string that is not empty
// Check every second
function checkDivsExist() {
let divs = document.querySelectorAll('div[class*="transcribe_contents"][data-private]');
console.log('Checking divs...', divs.length);
if (divs.length > 0) {
clearInterval(checkExistenceInterval);
let allTextContent = '';
divs.forEach(div => {
allTextContent += div.textContent + '\n\n';
});
let text = allTextContent.trim().toString();
console.log(`%c ${text}`, "color: #F9D71C; font-weight: bold;");
automaSetVariable('transcript2', text);
}
}
let checkExistenceInterval = setInterval(checkDivsExist, 1000);
automaNextBlock()```
here is another code that fails to add the variable to Automa :
function logTextFromLastAssistantMessage() {
let conversationTurns = document.querySelectorAll('div[data-testid*="conversation-turn"]');
let assistantMessages = Array.from(conversationTurns).filter(turn => turn.querySelector('div[data-message-author-role="assistant"]'));
let lastMessage = assistantMessages[assistantMessages.length - 2];
if (lastMessage) {
let textElements = lastMessage.querySelectorAll('p, ul, li, h1, h2, h3, h4, h5, h6');
let fullText = Array.from(textElements).map(element => element.textContent.trim()).join('\n');
console.log(fullText);
automaSetVariable('output', fullText);
return fullText;
} else {
console.log('No assistant message found');
return null;
}
Hello there, I'm 100% certain that automaSetVariable does fail to fetch variable that are valid in the Javascript.
For example, here is some code below, that does show a working string variable text in the console, but Automa does not add/show the variable transcript.
yet text variable is just a string that is not empty
function logTextFromLastAssistantMessage() { let conversationTurns = document.querySelectorAll('div[data-testid*="conversation-turn"]');
}
logTextFromLastAssistantMessage();
automaNextBlock()