JavaScript在控制台中运行但不在AppleScript中运行

时间:2016-04-21 17:56:18

标签: javascript applescript

以下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

感谢任何帮助?

0 个答案:

没有答案