Jump to content

Recommended Posts

Posted

I know zero about javascript so I was wondering....

  • is it possible using javascript to
  • open a program
  • make the opened program window selected
  • wait for a couple of seconds
  • then enter a key press (e.g. Ctrl+N)

if it is could someone write a generic one which I could edit myself.


Posted

Generally, Javascript is confined to the browser and all it's softwares used to open specific files as it is a browser language.

This means you probably could control the default Media player via the browser and the default text editor (by viewing source)... I am unsure if you could be specific though as I am only a begginner... and by that I mean I got to functions in the www.w3schools.com tutorial.

Posted

Browsers are specificly designed to PREVENT people from running programs through them. If anyone could make a simple javascript that ran a program on your computer, it would allow hackers and other evildoers to kill peoples computers.

If you want to learn windows automation scripting (which I personally recommend), try out AutoIt. You can easily make a simple script that will do exactly what you're asking for.

Posted

You know sometimes I should check my info before posting what I meant was is this possiblle using a vbs file. Something like this:

'Use all video formats with MediaPlayer classic

Set WshShell = WScript.CreateObject("WScript.Shell")
On Error Resume Next
WshShell.Popup "Do NOT MOVE the mouse an do NOT PRESS any button!",5," - Warning - ",48

WshShell.Run ("%programfiles%\MediaP~1\mplayerc.exe")

WScript.Sleep 2000
WshShell.SendKeys "%v"
WScript.Sleep 2000
WshShell.SendKeys "o"
WScript.Sleep 2000
WshShell.SendKeys "{DOWN}"
WScript.Sleep 2000
WshShell.SendKeys "%v"
WScript.Sleep 2000
WshShell.SendKeys "%b"
WScript.Sleep 1000
WshShell.SendKeys "~"
WScript.Sleep 2000
WshShell.SendKeys "%{F4}"
WScript.Sleep 2000
Wscript.Quit

I have tried editing one to do what I want but it doesn't work. I will give autoit a try but I don't know if it will do what I want (which is have a button in opera which will open my calendar program and startup the new task entry dialogue)

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...