Autohotkey and Moho

Discuss Moho bugs (or suspected bugs) with other users. To report bugs to Smith Micro, please visit support.smithmicro.com

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, Belgarath, slowtiger

Autohotkey and Moho

Postby Greenlaw » Mon Feb 11, 2019 2:50 pm

This weekend, I started having problems between Autohotkey and Moho. Both AHK and Moho are working fine individually but right now Moho is mostly ignoring AHK. It's not completely ignoring it because I see Moho flashing (beeping?) every time I try to use AHK to operate the Moho UI. It looks to me like AHK is still sending commands to Moho but Moho is rejecting them for some reason. Previously, AHK and Moho worked fine with each other.

I'm not seeing the same problem on another computer so I suspect something had changed on this computer to cause this issue but I can't figure out what that could be. Has anybody seen this problem on their computer and know what's going on?

This is frustrating because I was preparing to release a tool I've been using all last year and then this happens. :(

If anybody has a helpful suggestion, please reply. Thanks!
User avatar
Greenlaw
 
Posts: 4212
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles

Re: Autohotkey and Moho

Postby Greenlaw » Mon Feb 11, 2019 3:18 pm

Ok, it seems to be a permissions thing. When I set my AHK script to 'run as administrator', it's allowed to control Moho.

This is weird because I don't believe I had to do this before to use AHK with Moho. Does anybody know if something recently changed in Windows to cause this restriction? I know I can permanently change the permissions settings but I'd rather not do that if I don't have to.
User avatar
Greenlaw
 
Posts: 4212
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles

Re: Autohotkey and Moho

Postby Greenlaw » Mon Feb 11, 2019 3:34 pm

After a little research, I learned that UAC and other security changes can cause this. I should have mentioned that this is a new computer I'm using, so it's likely I adjusted an 'annoying' security option recently and hadn't immediately noticed the effect on AHK.

Apparently, I can get the script to 'Run As Admin' all by itself. Not exactly sure how but I'm going to look into it now.
User avatar
Greenlaw
 
Posts: 4212
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles

Re: Autohotkey and Moho

Postby Greenlaw » Mon Feb 11, 2019 4:00 pm

I'm guessing a recent Windows update made it more picky about running AHK scripts as .exe.

This bit of code seems to allows the script to work:

Code: Select all
if not A_IsAdmin
Run *RunAs "%A_ScriptFullPath%"

But unless I set UAC to its lowest setting, Windows keeps asking for permission to run every time I launch the script, which is pretty annoying.

Does anybody have a better 'in-script' solution?
User avatar
Greenlaw
 
Posts: 4212
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles

Re: Autohotkey and Moho

Postby Greenlaw » Mon Feb 11, 2019 4:28 pm

Sigh! Now I'm getting the Windows permission requester even when I run the ahk script (instead of the .exe). For now, I'm going to run the .exe with UAC set to its lowest setting on this computer. I don't think I had to do that on my older computer but will check on this when I can.

One of the reasons I started this project was to teach myself AutoHotkey, so when I post the tool later this week, I'll include the source code and maybe somebody can help me improve it.

I just need to record a video to show how I use the tool with Moho. When it's ready, I'll post the tool in the Scripting discussion.
Last edited by Greenlaw on Mon Feb 11, 2019 6:40 pm, edited 3 times in total.
User avatar
Greenlaw
 
Posts: 4212
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles

Re: Autohotkey and Moho

Postby synthsin75 » Mon Feb 11, 2019 4:44 pm

You might try "RunAs, Administrator", as per: https://autohotkey.com/docs/commands/RunAs.htm
- Wes
ImageImageImage
User avatar
synthsin75
 
Posts: 6997
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma

Re: Autohotkey and Moho

Postby Greenlaw » Mon Feb 11, 2019 6:35 pm

synthsin75 wrote:You might try "RunAs, Administrator", as per: https://autohotkey.com/docs/commands/RunAs.htm

Thanks! I'll give that a try with my laptop at lunchtime.

A minute ago, I checked how I have it configured on my work computer and I see I'm not using the Run As Administrator option in the AHK file properties, but then we're using Win 7 here so I'm guessing this is a Win 10 thing. That said, I'm almost certain I didn't have to do that on my old Win 10 computer. I still have that computer but will have to wait till this evening to check.
User avatar
Greenlaw
 
Posts: 4212
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles

Re: Autohotkey and Moho

Postby Greenlaw » Mon Feb 11, 2019 6:44 pm

Just curious but have you run into this issue on any computers? I'm trying to understand why I'm seeing this only on my new computer and wish to include any helpful troubleshooting info in the docs.
User avatar
Greenlaw
 
Posts: 4212
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles

Re: Autohotkey and Moho

Postby synthsin75 » Mon Feb 11, 2019 8:17 pm

Greenlaw wrote:Just curious but have you run into this issue on any computers? I'm trying to understand why I'm seeing this only on my new computer and wish to include any helpful troubleshooting info in the docs.


Gosh, if I have, it's been so long that I'm not likely to remember where or how I solved it. And I'm not running Win10 on anything.
- Wes
ImageImageImage
User avatar
synthsin75
 
Posts: 6997
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma

Re: Autohotkey and Moho

Postby Greenlaw » Mon Feb 11, 2019 8:30 pm

Ok, thanks. If I figure this out, I'll be sure to post the info here or in the upcoming thread.
User avatar
Greenlaw
 
Posts: 4212
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles

Re: Autohotkey and Moho

Postby Greenlaw » Mon Feb 11, 2019 10:45 pm

I tried the other Run As command but getting the same result: Windows is asking for permission before allowing the script to run. It only allows it to proceed automatically if I set UAC to never notify.

I suspect my old computer probably had UAC set to never notify. If that's the case, I guess it's just the way it has to be. Will check on this tonight.
User avatar
Greenlaw
 
Posts: 4212
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles

Re: Autohotkey and Moho

Postby synthsin75 » Mon Feb 11, 2019 11:06 pm

There's an off chance that calling the AHK from an already privilege-elevated program might work. If that's the case, you can alter the advanced properties of the Moho shortcut you use to make Moho always launch as admin. If that fails, you might try making a shortcut with admin privileges for the AHK exe and calling that from Moho.

Or maybe Moho is already running elevated, by default, and UAC is just trying to keep AHK from messing with it. If so, elevating the AHK script might work.

Some ideas to try anyway.
- Wes
ImageImageImage
User avatar
synthsin75
 
Posts: 6997
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma

Re: Autohotkey and Moho

Postby Greenlaw » Mon Feb 11, 2019 11:24 pm

Thanks! Yes, it's possible I elevated Moho on the old computer when I first started working with AHK. Will check if I did that.

Even if not, will try it on the new computer and see what happens.
User avatar
Greenlaw
 
Posts: 4212
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles

Re: Autohotkey and Moho

Postby Greenlaw » Wed Feb 13, 2019 4:19 pm

Ugh...busy week but finally got back to this.

I tried elevating Moho to run as admin but all that did was bring up the annoying permissions window, and the AHK script still couldn't control Moho unless it too had elevated privileges.

So for now, I dropped Moho back down to user, elevated the tool to run as admin, and am leaving UAC at its lowest setting. I still need to check if this is how it's set up on my old computer but I suspect it is. TBD.

At work, we're using Windows 7 and it all seems to work fine with regular user privileges. Sigh...Windows 10...
User avatar
Greenlaw
 
Posts: 4212
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles

Re: Autohotkey and Moho

Postby synthsin75 » Wed Feb 13, 2019 4:23 pm

Greenlaw wrote:Sigh...Windows 10...

Yeah, that's why I'm not looking to upgrade from 8.1 any time soon.
- Wes
ImageImageImage
User avatar
synthsin75
 
Posts: 6997
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma

Next

Return to Bug Discussions

Who is online

Users browsing this forum: No registered users and 1 guest

cron