以下JavaScript在控制台窗口中运行并返回我希望的结果:
var thisAddys = $('.persons .firstChild td').each(function() {
$(this).find('font').each(function() {
console.log('Data Found: ' + $(this).text());
});
});
但是当我尝试使用AppleScript运行JavaScript代码时,我得到了缺失值:
tell application "Safari"
activate
set theScript to "var thisAddys = $('.persons .firstChild td').each(function() {
$(this).find('font').each(function() {
console.log('Data Found: ' + $(this).text());
});
});"
set JSResults to do JavaScript theScript in current tab of first window
activate
end tell
感谢任何帮助?