X
Tap here to go to the mobile version of the site.
Your Firefox is out of date and may contain a security risk! Upgrade Firefox

Support Forum

Sendkeys -> Strg+C in Firefox zulassen

Posted

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

Additional System Details

Installed Plug-ins

  • Shockwave Flash 11.4 r402
  • VLC media player Web Plugin 2.0.2
  • Adobe PDF Plug-In For Firefox and Netscape "9.5.2"
  • Office Live Update v1.5
  • NPWLPG
  • DRM Netscape Network Object
  • Npdsplay dll
  • DRM Store Netscape Plugin
  • Office Plugin for Netscape Navigator

Application

  • User Agent: Mozilla/5.0 (Windows NT 5.1; rv:19.0) Gecko/20100101 Firefox/19.0

More Information

jscher2000
  • Top 10 Contributor
2366 solutions 20923 answers

Firefox does not natively run VBScript. Is your VBScript running externally to the browser, in the Windows Script Host?

Question owner

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

jscher2000
  • Top 10 Contributor
2366 solutions 20923 answers

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.

Question owner

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

jscher2000
  • Top 10 Contributor
2366 solutions 20923 answers

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.

Question owner

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