首页 > 解决方案 > AppleScript 发送 WhatsApp

问题描述

我正在使用 Code1 打开与手机上保存的号码的聊天,之后我使用另一个代码来编写和发送消息现在我想要一个新的代码而不是 code1 来打开与未保存的号码的聊天

代码1

on execute_javascript(jquery, whatsapp, conversation_title)
    set app_is_running to "Google Chrome"
    
    
    tell application "Google Chrome"
        tell active tab of window 1
            execute javascript ("var conversation_title = \"" & conversation_title & "\";")
            execute javascript jquery
            execute javascript whatsapp
        end tell
        
    end tell
end execute_javascript

on run (arguments)
    set javascript_folder to POSIX path of ((the path to me as text) & "::")
    set jquery_file to (POSIX file (javascript_folder & "js/jquery.min.js"))
    set whatsapp_file to (POSIX file (javascript_folder & "js/whatsapp.js"))
    
    open for access jquery_file
    set jquery to (read jquery_file)
    close access jquery_file
    
    open for access whatsapp_file
    set whatsapp to (read whatsapp_file)
    close access whatsapp_file
    
    set conversation_title to "conversation_title"
    
    return execute_javascript(jquery, whatsapp, conversation_title)
end run

标签: applescriptwhatsapp

解决方案


推荐阅读