473,652 Members | 2,935 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

help with pasting from clipboard to a windows program

3 New Member
Hi,
I am hoping someone knows how to finish this javascript. The script copies selected text to the windows clipboard from, for instance, a webpage. This text is a phone number. It then executes the windows phone dialer program. The cursor flashes in the dialer's input area. I need some more script that can focus on that area or cursor position and paste the phone number there. Right now a CTRL-V works, but I want it automated in script. It would be nice to then automatically press the DIAL NUMBER button and close the program after 5 seconds. Can I have it all?? Does the script have to "wait" for the program to load before pasting to it?

Expand|Select|Wrap|Line Numbers
  1. <script language="javascript"type="text/javascript">
  2. {
  3. // GET SELECTED TEXT
  4. var SelectedText = window.external.menuArguments.document.selection.c reateRange().text;
  5. // COPY IT TO CLIPBOARD
  6. window.clipboardData.setData("Text",SelectedText);
  7. }
  8.  
  9. var wsh = new ActiveXObject('WScript.Shell');
  10. wsh.Run("C:\\WINDOWS\\DIALER.exe")
  11.  
  12. </SCRIPT>
Mar 16 '08 #1
5 1734
gits
5,390 Recognized Expert Moderator Expert
please explain the purpose of that script ... it looks like a 'background-dialing' page and i think we will not support any thing that potentially could be considered as 'malware' ... i don't know if that is your intention but don't program such behaviour ... in case you need the dialing to send something to a phone or fax or whatever ... then submit the data to the server and dial from there ... otherwise the users will not accept your page ... i promise!

kind regards
Mar 17 '08 #2
bshul
3 New Member
please explain the purpose of that script ... it looks like a 'background-dialing' page and i think we will not support any thing that potentially could be considered as 'malware' ... i don't know if that is your intention but don't program such behaviour ... in case you need the dialing to send something to a phone or fax or whatever ... then submit the data to the server and dial from there ... otherwise the users will not accept your page ... i promise!
Hi,
Thanks for the cordiality, and the promise...I guess everyone sees the world in their own way...my way is to find someone smart enough to help me finish my script, so I can easily dial numbers from webpages on my home computer...any takers?

Sincerely,
Burt 845 298 4229
Mar 18 '08 #3
gits
5,390 Recognized Expert Moderator Expert
that surly has nothing to do with how someone sees the world ... it is a simple limit of the use of a technology ... imagine it would be possible to achieve your goal with a 'simple' webpage ... a user could be tricked and the page dials wherever it wants ... that is just a simple security-issue, that IS TO avoid ...

having said this ... you may look at some activeX components that you may include in your page ... may be there is a dialer-component out there and i guess you HAVE TO set IE's security settings to very loose to allow such a component to work ... another idea could be to use the WSH to get your task done ...

good luck with that ...
Mar 18 '08 #4
bshul
3 New Member
"Another idea could be to use the WSH to get your task done ...

good luck with that "

Could you elaborate (with script) on how you would use WSH to paste the clipboard into the program's window. I am not using this to generate a webpage to present to a user. I am using this (on my own win98 computer) to dial numbers that appear in a webpage.
Mar 18 '08 #5
gits
5,390 Recognized Expert Moderator Expert
i'm sorry ... it was just an idea to use the windows scripting host (WSH) for such an automation and i think it should be possible ... i'm not familiar with that and the only advice i could give is to start a thread in the misc or windows forum? ... i'm not quite sure where to put this ... or try a google search for explicit WSH-ressources and go on from there?

kind regards
Mar 18 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2485
by: Vlado | last post by:
Hello, I need to copy/paste image from Java application to/from the System clipboard. On windows everything is just fine, but on Mac OS is not. The problem is that when I transfer image to the clipboard it's content type is image/x-java-image and when I try to paste it in some Mac application (for example MS Worf for Mac OS) it doesn't work. I think that this happens, because Word doens't understand the image/x-java-image content type....
6
3438
by: Just Me | last post by:
I've seen code that copies a bmp file into a RichTextBox by first putting it into the clipboard and then using Paste to get it into the RichtextBox. This destroys the clipboard contents. Is there an easy way to save the clipboard contents and then restore it? Thanks
3
9906
by: | last post by:
I wrote a class in VB.NET to export the contents of a datagrid to Excel. It works perfectly on my machine, but it fails on my customers' PCs that have identical versions of Win XP (SP1) and Excel (SP1) installed. The error is: System.Runtime.InteropServices.COMException(0x800A03EC): Exception from HRESULT: 0x800A03EC. at Microsoft.Office.Interop.Excel._Worksheet.Paste(Object Destination, Object Link) at...
1
1083
by: Phill. W | last post by:
(Apologies if I've missed the answer someplace else, but ... ) Is it possible in "intercept" the actions of the standard (Cut'n'Paste) context menu provided by a TextBox (or derived class thereof) to manipulate the data going to and/or from the Clipboard? Short of completely recplacing the standard one with a Context menu of my own, I can't find any way of doing this. TIA,
4
1217
by: hamil | last post by:
I would like to right click and select (copy )a file (or directory) name in Windows Explorer and then paste the file (or directory) name into a text box on a vb.net form. Can anyone explain how to do this? thanks. Hamil.
1
9012
by: Tim Marshall | last post by:
In my not too successful attempts to get an OLE chart object (Graph 11.0) that has been manipulated on a form to be reproduced on a report, I am considering the following procedure. First copy the graph area to the clip board (easy enough using Me.OleGraphControl.ChartArea.Copy). Next open an instance of MS Paint, paste the clipboard into the file and save as something like "Picture.bmp" in the same directory as the FE Access app. A...
15
12285
by: Peter Duniho | last post by:
I'm trying to use .NET and C# to draw a metafile copied to the clipboard by another application (Word 2003 in this case, but it shouldn't matter). I naively thought that I'd be able to use the Clipboard class to get an EnhancedMetafile or MetafilePict object from the Clipboard, use that to create a new Metafile object, and then draw that Metafile object using Graphics.DrawImage. It doesn't seem to be that simple.
5
6857
by: exhuma.twn | last post by:
As many might know, windows allows to copy an image into the clipboard by pressing the "Print Screen" button on the keyboard. Is it possible to paste such an image from the clipboard into a "Text" widget in Tkinter? Here is my first attempt with just trying to print out the image data: ----------------- def pasteImg(tgt): global clipboardEnabled if not clipboardEnabled: return
8
2488
by: active | last post by:
Guess I'm looking for someone who likes to work difficult puzzles. I can't seem to ever retrieve a palette handle from the clipboard. Below is a simple test program that demonstrates the problem. The program uses windows api to get a handle to a palette from the clipboard. The palette needs to be put there by another program - maybe Photoshop.
0
8370
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8704
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8470
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8590
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5620
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4147
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1591
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.