Я пытаюсь выбрать все вопросы и вставить их в Excel, каждый вопрос в отдельной ячейке.Я просто не уверен, как отформатировать код, чтобы сделать это, сейчас он вставляет все вопросы в одну ячейку.
Заранее спасибо за вашу помощь.
tell application "Safari"
set question to do JavaScript "
var outPut=[];
var arr=document.querySelectorAll('.question_body');
for (var i=0; i < arr.length; i++) {
if(arr[i].innerHTML !== ''){
outPut.push(arr[i].innerHTML.trim())
}
};
outPut;" in document 1
end tell
set saveTID to text item delimiters
set text item delimiters to "***"
set questions to question as string
set text item delimiters to saveTID
set the clipboard to questions
tell application "Microsoft Excel"
activate
--repeat 3 times
--tell application "System Events" to keystroke "u" using control down
tell application "System Events" to keystroke "v" using command down
--tell application "System Events" to keystroke "u" using control down
--tell application "System Events" to key code 125
--end repeat
end tell