How to send the "#" symbol with NirCmd sendkeys - scripting

Using NirCmd sendkeys functions, I am trying to send the # symbol to firefox to automate logins that contain my email address but can't seem to find the right code for the # key. Any help is appreciated.

A normal keyboard don't have the # key.
Maybe you could try sending SHIFT and 2 at the same time.
However, I think AutoHotKey is more suitable for this kind of task.

Related

How to send Control / in AHK

I'm trying to send Control Forward Slash at one time in an AHK script.
I've tried:
Send ^{/}
Send ^/
Send {Ctrl Down}/{Ctrl Up}
I've also tried SendInput instead of just Send.
None of them are working. I'm wanting to go to the search bar in the program my company uses but I can't get Control + Forward Slash to work
Explain what you want to do and what should be accomplished by your code.
Are you asking how to send those characters to text, or how to emulate the pressing of those characters on your keyboard - like sending a hotkey?
^/ works just like that as a hotkey trigger on my std US keyboard (the / being the unshifted ? key).
If you are trying to send it as literal text, it is the control key ^ you have to escape. So:
Send {^}/
would type it out as ^/
Using Send ^/ has the effect of whatever pressing control-slash is supposed to do. For me, that's nothing special except in apps that map it to something. If you want it as a hotkey and to refer to it in other parts of your code, give it a subroutine name as well, and just call it when needed.
my_subroutine:
^/::
MsgBox Hello World
return
. . .
gosub my_subroutine

Excel Macro to get by Security PopUp

I am trying to write a macro to log into a website but I keep getting stopped by a security alert pop up that requires me to click OK to continue. Any idea what lines to put in to make it click on the OK button so I can proceed to the site?
If you want to stick with VBA, a few options come to mind. The quick and dirty approach would just be to use Sendkeys, and send Enter. It's super unreliable though, but may work in your specific case.
Another option is using windows APIs to send/post the relevant message to the window. See here
The final option I'll offer is considering Authotkey as a language stand-in. It makes this type of interaction really easy. It has COM support, so you can still use Excel, just like VBA.
http://www.contextures.com/excelvbasendkeys.html
SendKeys should be able to do this I think...
SendKeys "~"
O

Is there a list of Bloomberg DDE commands?

I'm trying to interface with Bloomberg Pro using DDEExecute but I'm having trouble finding a list of valid DDE commands.
In particular what I'm hoping to do right now is enter specific non-character keystrokes (e.g. "right arrow")
I agree with others that API is the way to go, but if for some reason you do not have the data, you can use a few different approaches including DDE or Sendkeys. I don't believe there is a list though, as bloomberg has said "Although the DDE and SendKeys functionality is documented here, we are unable to assist with specific uses of this functionality"
SendKeys method can be used in the following way:
' Activate a Bloomberg Professional Window (Window #1, in this case)
AppActivate "1-BLOOMBERG"
' Send commands to the Bloomberg Professional service Window
SendKeys "{ESC}" & "MSFT US {f8} DES~", True
Additional help on the "SendKeys" methods [Syntax of the keystrokes] can also be found in the MSDN Library - VBA Help Files, as well as in the Add-Ins Help file. This file can be opened from the Windows task bar by clicking the START menu and then Programs|Bloomberg.
The list including right arrow can be found here.

How to speed up sendkeys() in Internet Explorer when using Selenium-Webdriver 2.0?

I'm currently testing on Internet Explorer 8. My script types in a username and password and logs into a website.
The problem is that the sendkeys() function takes forever to finish. The username is only 8 characters long, but takes about 30 - 40 seconds to enter in. As my tests expand, this is going to translate into tests that take forever to complete.
How can I speed up this operation? I'd prefer not to use native javascript to enter in data.
You basically have two options for entering text in fields:
sendkeys()
javascript
The first isn't working for you, and you've decided against the second for whatever reason, which leaves just one other thing you could try - a different IE configuration. Try turning protected mode off for all zones (or on if you have it off), sometimes that can make a difference for performance.
In order to make the sendKeys work, I used the following method:
use JavaScript to set the value of the input but leave out the last character
use sendKeys to enter the missing character
An example of entering an IBAN CH1709000000147117606 looks like this
browser.executeAsyncScript(function(callback){
document.getElementsByName("kontoNummer")[0].value = "CH170900000014711760";
callback();
}).then(page.kontoNummer.sendKeys('6'));
The reason why the last character is still entered via sendKeys is because it sets the focus on the form element and allows for correct event triggering

How can I know if the user is in Exposé mode?

Is there a way to find out if the user is in the Exposé mode? (i.e., all windows are being shown.) Thank you.
There's no public API for getting this information. What problem are you trying to solve?
You don't need this information. If the user is not in Exposé, F11 (or fn-F11) will enter Exposé. If the user is already in Exposé, F11 (or fn-F11) will exit Exposé. So just send F11 (or fn-F11) unconditionally.
The real challenge is determining the correct key command to send. On a laptop or small Apple Wireless Keyboard, the command may include the fn modifier, but on a desktop machine with a full-size keyboard, the command will more probably be F11 alone. Furthermore, it's user-configurable.
The correct way to toggle Exposé programmatically is a separate question.