I need a way to select a user in skype using AppleScript, is this possible. I've tried to use Keyboard Maestro for the find an image action to select a user but it didn't work.
1 Answers
Skype isn't scriptable, and it's not accessible to UI scripting either. 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 has a URI scheme that provides access to very basic functionality, including opening a chat with another user:
skype://john.smith?chat
skype://john.smith?chat
The useful thing about this is that it works across different platforms, including macOS, iOS, and 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). 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.
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:
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. 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.
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.
I suggest replacing john.smith
with a username from your contacts, otherwise he may get upset if everyone starts chatting to him.

- 5,732
- 1
- 8
- 26
-
How would the full AppleScript look like? Sorry not very good with AppleScript yet. – Abdallah Anwar Apr 09 '20 at 23:27
-
Where would the contact name of the user being sent the message in the script go? – Abdallah Anwar Apr 12 '20 at 06:19
-
Sorry, I thought I edited my answer in response to your first question, but clearly I didn't save and submit it. Darn. Let me do it again. – CJK Apr 12 '20 at 18:46