Link to home
Start Free TrialLog in
Avatar of WeThotUWasAToad
WeThotUWasAToad

asked on

Some AHK commands fail in Microsoft OneNote

Hello,

Is there a known AHK bug in Microsoft OneNote?

I've never been able to get Send {Down} or Send {Up} to execute in OneNote (2013) and now I've noticed that I also cannot get a Right-Click:

F1::Send {Right}
F2::Send {Left}
F3::Click
F4::MouseClick, Left
F5::Send {Down}
F6::Send {Up}
F7::Click Right
F8::MouseClick, Right

Open in new window


As expected, all of the above commands execute just fine in any other app. In OneNote however, only F1 thru F4 execute; F5 thru F8 do nothing.

Could someone who uses both programs test the above script? That would quickly indicate whether the problem lies with one or both apps vs with my system.

I anticipate that the problem is with my system. However, I did find a post from another user in the AHK Forum who described a similar problem (https://autohotkey.com/boards/viewtopic.php?f=5&t=25925&p=122104&hilit=ahk+onenote#p122104).

If the problem is with my system, what could be causing that behavior? On the other hand, if others find the same problem, can anyone think of a workaround?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Joe Winograd
Joe Winograd
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of WeThotUWasAToad
WeThotUWasAToad

ASKER

Thanks a bunch for taking a stab at this Joe. I tried each of your suggestions but unfortunately, none of them changed the current behavior. For that reason, I am very interested in finding out if other users are experiencing the same things.

Thanks to your post however, I did make one very beneficial discovery serendipitously — in fact it gave me a solution to the reason I opened this thread in the first place. At one point — while trying different variations of the Send command — I inadvertently double-pressed F8, the hotkey I designated above for one form of Right-click:

F8::MouseClick, Right

and bang! there was my Right-click menu! I almost didn't recognize what had happened but then doing it again (purposely this time), I was able to consistently reproduce it. So strangely, the following gives me just what I was looking for (ie sending a manual right-click):

F8::
	MouseClick, Right
		Sleep, 100
	MouseClick, Right
Return

Open in new window

I don't know what sending the command twice in close succession does but it's working. By the way, I tried the same thing for Send {Up} and Send {Down} but unfortunately did not get the same result.

So once again Joe, you have given me a solution, albeit a somewhat circuitous one in this case! :)

Thanks
Strange stuff! I don't understand why sending two right-clicks 100ms apart would result in the context menu. I don't think it's an AHK issue, so likely something weird with OneNote, about which I know nothing. If you still want me to try it in a sandbox, please let me know about your Office, Windows, and AHK versions, including bit-levels. Regards, Joe
Thanks again Joe.

No need to spend more time on this. I suspect it is something funny with my system but anything like that will be purged soon.

FYI, I spoke on the phone a couple of days ago, with my nephew (who built my current system). He's going to be in town the 1st week of February so we decided that it is time for a new processor and new C drive, and also — although I have been avoiding it — it's probably time for me to upgrade to Windows 10.

It's been 3 years since I reformatted and reloaded all my software so I'm anticipating (hoping) that a bunch of glitches will go away.
You're welcome, Steve. That all sounds good. But before you go to W10, make sure all of your important and/or expensive peripherals have W10 drivers or, at the very least, that they will function properly in compatibility mode in W10. If you would have to spend thousands of dollars replacing "oldies but goodies" peripherals, you may want to consider sticking with W7, which, imo, is still a perfectly fine OS for production usage. The same caveat applies to your important and/or expensive software. Regards, Joe