unabatedshagie Posted July 30, 2004 Posted July 30, 2004 I know zero about javascript so I was wondering....is it possible using javascript to open a programmake the opened program window selectedwait for a couple of secondsthen enter a key press (e.g. Ctrl+N)if it is could someone write a generic one which I could edit myself.
xan Posted July 30, 2004 Posted July 30, 2004 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.
DarkPhoenix Posted July 30, 2004 Posted July 30, 2004 I think he means javascript, as in Windows Script Host, not as in a Browser..
neosapience Posted July 31, 2004 Posted July 31, 2004 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.
unabatedshagie Posted July 31, 2004 Author Posted July 31, 2004 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 classicSet WshShell = WScript.CreateObject("WScript.Shell")On Error Resume NextWshShell.Popup "Do NOT MOVE the mouse an do NOT PRESS any button!",5," - Warning - ",48WshShell.Run ("%programfiles%\MediaP~1\mplayerc.exe")WScript.Sleep 2000WshShell.SendKeys "%v"WScript.Sleep 2000WshShell.SendKeys "o"WScript.Sleep 2000WshShell.SendKeys "{DOWN}"WScript.Sleep 2000WshShell.SendKeys "%v"WScript.Sleep 2000WshShell.SendKeys "%b"WScript.Sleep 1000WshShell.SendKeys "~"WScript.Sleep 2000WshShell.SendKeys "%{F4}"WScript.Sleep 2000Wscript.QuitI 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)
DarkPhoenix Posted July 31, 2004 Posted July 31, 2004 AutoIt rules for that kind of thing. So do listen to neosapience. WScript sucks compared to it.
prathapml Posted July 31, 2004 Posted July 31, 2004 is it possible using javascript to ..........Yes, possible - and it works perfectly!Go here and have a look: using JS for UI actions
unabatedshagie Posted July 31, 2004 Author Posted July 31, 2004 After a little bit of figuring out I have got autoit do do what I wanted.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now