cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MLaverick
Regular Visitor

Cannot send Alt+F2 command

Hi all, 

 

I need to send Alt+F2 to an application. I am successfully focusing the window then I tried using the "Send Keys" node to send the command. I found this solution on the forum so have tried the following:

 

  1. {Alt}{F2}
  2. {LMenu}{F2}
  3. {Alt}({F2})
  4. {LMenu}({F2})
  5. {F2}({Alt})
  6. {F2}({LMenu})

None of which worked.

I have tried with a large delay on the "Send Keys" node and a 0 delay, and also sending as hardware keys.

 

I recorded my action and the macro recorder showed the combination as {LMenu}(){F2} which also didn't work.

I then tried using a combination of "Press/Release Key" to hold the Alt key and "Send Keys" to send the F2 command

 

PAD.Designer_5r9nAmm1y7.png

 

Each combination I have tried only seems to be sending the F2 command.

 

Other things I have tried: 

  1. Refocusing the window before sending the command
  2. Forcing a release of the Alt key using "Press/Release Key"
  3. Sending the command multiple times with delays

Unfortunately I'm also unable to rebind the key combination, so I've hit a bit of a road block.

 

Thanks in advance,

 

Matt

 

9 REPLIES 9
MichaelAnnis
Super User
Super User

Hey Matt,

 

You seem to be on the right track.  A shame it's not working.

 

{Alt}({F2}) would be Hold Alt down while pressing F2

{Alt}(){F2} would be Press Alt, Then press F2

 

By default, "Send Text as hardware keys" should be off.  I have never had to turn it on.  But for the sake of troubleshooting have you tried both on and off?

Hi Michael,

 

Thanks for the quick reply. 

Yes I have tried with "Send Text as hardware keys" on and off.

The odd thing is, I have just tried it in a loop and it works once in a while, maybe every 15 tries. Doing it manually works every time so I don't think it's the application

That's so weird.  Anything you can do to utilize that, such as set up the loop and before it attempts it again, say, If element exists, Exit Loop.

Yes that's what I am doing currently. I check for an image to see if the UI has loaded then exit the loop. But with the time it takes to check for the image and with success being so infrequent, the task I'm trying to automate would take several hours

LucianoGomesBR
Advocate I
Advocate I

@MLaverick , I had the same issue sending keys to MS Excel.
I solved the issue adding Waits before and after the Send Keys.
I tried to remove one and other and now it is working fine.
I also tried to use a shorter and a longer "Delay between keystrokes", but adding the Waits solved the issue.

LucianoGomesBR_0-1641930082304.png

 

Hi @LucianoGomesBR

Thanks for the reply, unfortunately that didn't work either.

I have it working if I just loop the command over and over until the menu is recognised so will stick with this for now, but this makes me think that there might be a bug.

It works a lot quicker outside of the debug mode so it's mostly fine.

Would try F12 instead of Alt F2?

There might be several solutions for Save As.

1. Press Alt then F2;

2. Press F12;

3. Save As;
4. Close Save As

So I guess whether the problem is not in the key you press but the window where you are.

Hi @Benny_1857

It's actually a shortcut to open an NVidia tool, "Ansel" for taking 360 screenshots.

 

Thanks for the suggestion. 

 

Matt

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Top Kudoed Authors
Users online (1,958)