help with pasting from clipboard to a windows program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bshul
    New Member
    • Mar 2008
    • 3

    help with pasting from clipboard to a windows program

    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?

    [CODE=javascript]<script language="javas cript"type="tex t/javascript">
    {
    // GET SELECTED TEXT
    var SelectedText = window.external .menuArguments. document.select ion.c reateRange().te xt;
    // COPY IT TO CLIPBOARD
    window.clipboar dData.setData(" Text",SelectedT ext);
    }

    var wsh = new ActiveXObject(' WScript.Shell') ;
    wsh.Run("C:\\WI NDOWS\\DIALER.e xe")

    </SCRIPT>[/CODE]
    Last edited by gits; Mar 17 '08, 07:57 AM. Reason: added code tags
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    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

    Comment

    • bshul
      New Member
      • Mar 2008
      • 3

      #3
      Originally posted by gits
      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
      Last edited by gits; Mar 18 '08, 07:17 AM. Reason: fix quote tags

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #4
        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 ...

        Comment

        • bshul
          New Member
          • Mar 2008
          • 3

          #5
          "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.

          Comment

          • gits
            Recognized Expert Moderator Expert
            • May 2007
            • 5390

            #6
            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

            Comment

            Working...