Hice un script para rellenar un libro de texto en una página web interna, pero los desarrolladores de mi empresa cambiaron el código por lo que mi código de abajo ya no funciona
tell application "Safari" to tell window id theWINID to do JavaScript "document.getElementsByClassName('text-entry')[0].value=" & quoted form of myCaseNote in tab 1
aquí está el código del campo de texto de la página
He intentado muchas cosas pero parece que no puedo cambiar el texto (en la imagen demo "texto que necesito pegar")
cualquier ayuda será muy apreciada
<div lobid="##" data="[object Object]" casenotedata="[object Object]" caseid="5sd4sd-sd55sd-5sds5-sds5-sdsd55s" class="css-bzgzwc"><div class="note-input css-1d9ma27" data-cy="note-input"><div class="textarea-container"><div class="form-textarea-container css-9db1eh"><div class="form-textbox"><div class="form-textarea focused"><textarea aria-invalid="false" id="form-textarea-123" name="note-input-224" aria-labelledby="form-textarea-123_label" aria-describedby=""></textarea></div><span id="form-textarea-123_label" class="form-textbox-label" aria-hidden="true">Note</span></div></div></div></div><div class="note-toolbar css-o3el1q" data-cy="note-toolbar"><div class="buttons-container"><button class="add-note-button" type="button">Apply</button></div></div></div>
<div class="note-input css-1d9ma27" data-cy="note-input"><div class="textarea-container"><div class="form-textarea-container css-9db1eh"><div class="form-textbox"><div class="form-textarea focused"><textarea aria-invalid="false" id="form-textarea-123" name="note-input-224" aria-labelledby="form-textarea-123_label" aria-describedby=""></textarea></div><span id="form-textarea-123_label" class="form-textbox-label" aria-hidden="true">Note</span></div></div></div></div>
<div class="form-textarea-container css-9db1eh"><div class="form-textbox"><div class="form-textarea focused"><textarea aria-invalid="false" id="form-textarea-123" name="note-input-224" aria-labelledby="form-textarea-123_label" aria-describedby=""></textarea></div><span id="form-textarea-123_label" class="form-textbox-label" aria-hidden="true">Note</span></div></div>
<div class="textarea-container"><div class="form-textarea-container css-9db1eh"><div class="form-textbox"><div class="form-textarea focused"><textarea aria-invalid="false" id="form-textarea-123" name="note-input-224" aria-labelledby="form-textarea-123_label" aria-describedby=""></textarea></div><span id="form-textarea-123_label" class="form-textbox-label" aria-hidden="true">Note</span></div></div></div>
<div class="form-textarea focused"><textarea aria-invalid="false" id="form-textarea-123" name="note-input-224" aria-labelledby="form-textarea-123_label" aria-describedby=""></textarea></div>
<div class="form-textbox"><div class="form-textarea focused"><textarea aria-invalid="false" id="form-textarea-123" name="note-input-224" aria-labelledby="form-textarea-123_label" aria-describedby=""></textarea></div><span id="form-textarea-123_label" class="form-textbox-label" aria-hidden="true">Note</span></div>
<textarea aria-invalid="false" id="form-textarea-123" name="note-input-224" aria-labelledby="form-textarea-123_label" aria-describedby=""></textarea>
<div class="form-textarea focused"><textarea aria-invalid="false" id="form-textarea-123" name="note-input-224" aria-labelledby="form-textarea-123_label" aria-describedby=""></textarea></div>
<span id="form-textarea-123_label" class="form-textbox-label" aria-hidden="true">Note</span>
<div class="form-textbox"><div class="form-textarea focused"><textarea aria-invalid="false" id="form-textarea-123" name="note-input-224" aria-labelledby="form-textarea-123_label" aria-describedby=""></textarea></div><span id="form-textarea-123_label" class="form-textbox-label" aria-hidden="true">Note</span></div>
<div class="form-textarea-container css-9db1eh"><div class="form-textbox"><div class="form-textarea focused"><textarea aria-invalid="false" id="form-textarea-123" name="note-input-224" aria-labelledby="form-textarea-123_label" aria-describedby=""></textarea></div><span id="form-textarea-123_label" class="form-textbox-label" aria-hidden="true">Note</span></div></div>
<div class="textarea-container"><div class="form-textarea-container css-9db1eh"><div class="form-textbox"><div class="form-textarea focused"><textarea aria-invalid="false" id="form-textarea-123" name="note-input-224" aria-labelledby="form-textarea-123_label" aria-describedby=""></textarea></div><span id="form-textarea-123_label" class="form-textbox-label" aria-hidden="true">Note</span></div></div></div>
<div class="note-input css-1d9ma27" data-cy="note-input"><div class="textarea-container"><div class="form-textarea-container css-9db1eh"><div class="form-textbox"><div class="form-textarea focused"><textarea aria-invalid="false" id="form-textarea-123" name="note-input-224" aria-labelledby="form-textarea-123_label" aria-describedby=""></textarea></div><span id="form-textarea-123_label" class="form-textbox-label" aria-hidden="true">Note</span></div></div></div></div>
<div class="note-toolbar css-o3el1q" data-cy="note-toolbar"><div class="buttons-container"><button class="add-note-button" type="button">Apply</button></div></div>
<div lobid="iTunes" data="[object Object]" casenotedata="[object Object]" caseid="bf4ecda0-113e-11ec-944e-9bd3d18184e9" class="css-bzgzwc"><div class="note-input css-1d9ma27" data-cy="note-input"><div class="textarea-container"><div class="form-textarea-container css-9db1eh"><div class="form-textbox"><div class="form-textarea focused"><textarea aria-invalid="false" id="form-textarea-123" name="note-input-224" aria-labelledby="form-textarea-123_label" aria-describedby=""></textarea></div><span id="form-textarea-123_label" class="form-textbox-label" aria-hidden="true">Note</span></div></div></div></div><div class="note-toolbar css-o3el1q" data-cy="note-toolbar"><div class="buttons-container"><button class="add-note-button" type="button">Apply</button></div></div></div>
esto funciona pero parece que form-textarea-123 está cambiando todo el tiempo (los dígitos)
tell application "Safari"
do JavaScript "document.getElementById('form-textarea-123').value = 'demo'" in current tab of window 1
end tell
el código real
<textarea aria-invalid="false" id="form-textarea-123" name="note-input-224" aria-labelledby="form-textarea-123_label" aria-describedby=""></textarea>
Esto tampoco funciona:
do JavaScript "document.getElementById('form-textarea').innerText;" in current tab of window 1