Skype refuses to excecute ahk scripts Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
User avatar
entropy
Posts: 93
Joined: 17 Oct 2014, 01:45

Skype refuses to excecute ahk scripts

Post by entropy » 27 Mar 2023, 02:04

Hello,
I’m trying to assign HotKeys to Skype but nothing happens. Skype refuses to execute even global shortcuts that every other application does execute.
Besides this, every time the Skype window has been active, I have to reload my AutoHotKey script, when Skype is minimised, because nothing works.
I’m using Skype as an example because it's a well known app but this happens also with other applications such as SyncBack (a backup app from 2BrightSparks) and Revo Uninstaller Pro.

Does anyone know why this is happening and how could I bypass it?

User avatar
mikeyww
Posts: 26601
Joined: 09 Sep 2014, 18:38

Re: Skype refuses to excecute ahk scripts

Post by mikeyww » 27 Mar 2023, 07:20

When you post a question, I recommend including your script. This enables the reader to help you assess the script itself.

The following worked here.

Code: Select all

#Requires AutoHotkey v2.0

#HotIf WinExist('ahk_exe Skype.exe')
F3:: {
 WinActivate
 MouseMove 181, 199
 ; Click
 SoundBeep 1500
}
#HotIf
Incidentally, I believe that there is a documentation error for MouseMove, as it indicates the following.
Coordinates are relative to the active window unless CoordMode was used to change that.
Coordinates are actually relative to the client area by default in v2.

A misplaced directive could easily cause the problem that you are experiencing.

User avatar
entropy
Posts: 93
Joined: 17 Oct 2014, 01:45

Re: Skype refuses to excecute ahk scripts

Post by entropy » 27 Mar 2023, 08:21

Sorry, but the point is that no code is being executed.

For example, I’m on Skype and I’m trying to write a message and I type something wrong. Instead of using both fingers to undo (Ctrl+z), I assigned the key f2 to do the job. This key works fine in all applications I use it as undo. But in Skype, it does nothing while Ctrl+z does.
This is the code:

Code: Select all

#HotIf WinExist('ahk_exe Skype.exe')

F2::Send "^z"

#HotIf
No HotKeys are being executed while the Skype window is active as is the case with the other apps I mentioned.
For example, while the Skype window is active not even global keys are being executed that have nothing to do with Skype. Win + t opens task manager no matter which application is active (custom HotKey). When Skype is active Win+ t does what Win + t normally does (Cycle through apps on the taskbar.)
Can you run ahk scripts on Skype?

gregster
Posts: 8921
Joined: 30 Sep 2013, 06:48

Re: Skype refuses to excecute ahk scripts  Topic is solved

Post by gregster » 27 Mar 2023, 08:31

Probably a permissions issue, and you are running Skype with admin rights.: https://www.autohotkey.com/docs/v2/FAQ.htm#uac

User avatar
entropy
Posts: 93
Joined: 17 Oct 2014, 01:45

Re: Skype refuses to excecute ahk scripts

Post by entropy » 27 Mar 2023, 08:58

gregster wrote:
27 Mar 2023, 08:31
Probably a permissions issue, and you are running Skype with admin rights.: https://www.autohotkey.com/docs/v2/FAQ.htm#uac
This solved the issue: Right-click the script in Explorer and select Run with UI access.

However, in my windows startup folder, all AutoHotKeys load when windows starts.
Would you know how to go around this problem so I won’t need every time I restart my computer to run the scripts manually with UI access?

Thank you!

User avatar
mikeyww
Posts: 26601
Joined: 09 Sep 2014, 18:38

Re: Skype refuses to excecute ahk scripts

Post by mikeyww » 27 Mar 2023, 08:59

https://www.autohotkey.com/docs/v2/FAQ.htm#uac

Running Skype as admin is not necessary for it to work.

User avatar
entropy
Posts: 93
Joined: 17 Oct 2014, 01:45

Re: Skype refuses to excecute ahk scripts

Post by entropy » 27 Mar 2023, 09:21

I read the article and the launcher gives the option to run the scripts with UI access. I just restarted my computer to be sure and indeed it launches the scripts with UI access.

Thank you both guys for your help!

Post Reply

Return to “Ask for Help (v2)”