简体   繁体   English

Skype 中的用户是否存在 AppleScript 到 select 的用户

[英]Is there an AppleScript to select a User In Skype

I need a way to select a user in skype using AppleScript, is this possible.我需要一种方法来 select 使用 AppleScript 的 Skype 用户,这可能吗? I've tried to use Keyboard Maestro for the find an image action to select a user but it didn't work.我尝试使用键盘大师来查找用户 select 的图像操作,但它没有用。

Skype isn't scriptable, and it's not accessible to UI scripting either. Skype 不可编写脚本,并且 UI 脚本也无法访问它。 So, while it's not possible to simulate a click on a Skype contact, it is possible to open up a chat with one, if that's something you want to do.因此,虽然无法模拟对 Skype 联系人的点击,但如果您想做的话,可以打开与某人的聊天。

Skype has a URI scheme that provides access to very basic functionality, including opening a chat with another user: Skype 有一个 URI 方案,可以访问非常基本的功能,包括打开与另一个用户的聊天:

 skype://john.smith?chat

The useful thing about this is that it works across different platforms, including macOS, iOS, and Android.有用的是它可以跨不同平台工作,包括 macOS、iOS 和 Android。 On Windows, it's a little more strict with the format, and you may have to omit the two forward slashes (but retain the colon).在 Windows 上,它的格式更严格一些,您可能必须省略两个正斜杠(但保留冒号)。 But if you copy and paste that URL into your web browser, you should find it opens a chat in Skype with whomever john.smith turns out to be.但是,如果您将 URL 复制并粘贴到您的 web 浏览器中,您应该会发现它会在 Skype 中打开与john.smith的任何人的聊天。

We can use AppleScript to wrap this inside a handler, to which we can pass any username we wish to have it trigger this URL:我们可以使用 AppleScript 将其包装在一个处理程序中,我们可以将任何我们希望让它触发此 URL 的用户名传递给该处理程序:

to chat to username
        local username
        set URI to ["skype:", username, "?chat"]
        open location URI as text
end chat

It will open Skype up directly, without having to open a web browser.它将直接打开 Skype,而无需打开 web 浏览器。 To use this handler, you'd call it inside your script like so:要使用此处理程序,您可以在脚本中调用它,如下所示:

chat to "john.smith"

Then when the script is run, it will open a chat with john.smith in Skype.然后当脚本运行时,它将在 Skype 中打开与john.smith的聊天。

Note that you need to supply a Skype username (which is also referred to a Skype Name . This is the one a person can use to log in to Skype, which they choose and set during the sign-up process, after which it cannot be changed. It is not the display name that appears in your contact list, which can be edited by both the user and by you.请注意,您需要提供一个 Skype用户名(也称为Skype Name 。这是一个人可以用来登录 Skype 的用户名,他们在注册过程中选择和设置,之后就不能已更改。不是出现在您的联系人列表中的显示名称,用户和您都可以编辑该名称。

I suggest replacing john.smith with a username from your contacts, otherwise he may get upset if everyone starts chatting to him.我建议用您联系人中的用户名替换john.smith ,否则如果每个人都开始与他聊天,他可能会生气。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM