
Sendkeys -> Strg+C in Firefox zulassen
Hallo!
Ich möchte mit einem VBScript einen in Firefox markierten Text über Sendkeys->Strg+C in die Zwischenablage kopieren. Firefox blockiert das aber. Das Skript funktioniert bei allen andern Programmen. Nur nicht bei Firefox. Ich kann mir nur denken dass Skript-Zugriffe auf die Zwischenablage aus Sicherheitsgründen gesperrt sind. Wie kann ich das erlauben?
Gruß, Johannes
Tutte le risposte (6)
Firefox does not natively run VBScript. Is your VBScript running externally to the browser, in the Windows Script Host?
Hello jscher2000,
My VBScript is running externally in the Windows Script Host as you said.
When I mark a word in a firefox tab and press Ctrl+C it's copied to the clipboard. When I start the script and sendkeys "presses" the same Ctrl+C combination it's NOT copied to the clipboard. So the only thing I can imagine is some kind of blocking of my script by firefox, but I have no idea why and how firefox would block this as sendkeys just simulates the keystrokes. The programm doesn't know that the keystrokes don't come from the keyboard, right?
Regards, Johannes
I haven't tried that... If you send Ctrl+t does Firefox open a new tab? If so, but "in page" operations do not work as expected, the focus might not be in the page.
Jep, Crtl + T does work. I think you are right. Maybe the focus of the page gets lost when the script starts. Unfortunately I don't know a vbscript command to get the focus of a page or tab back. I only know WshShell.AppActivate "Firefox" which gets the focus on the Firefox-window.
Regards, Johannes
What if you send Ctrl+E to focus the search box and then Tab to move the focus to the document? Oh wait, that might clear the selection. This is a puzzle.
Ahaha, I'm so stupid! I wrote Sendkeys "^C" in my script because the letters on the keyboard are printed upper case! Like you wrote Ctrl+E in your last post. Well, in fact it's Ctrl+c or Ctrl+e, because Ctrl+C means Ctrl+Shift+c. All programs I tested my script on aren't case sensitive but Firefox is! In Firefox there are Ctrl+Shift shortcuts. I changed my script and now it's working!
Thank's a lot for your time and help!
Gruß, Johannes