I am creating a script that runs from a program called MaxIm DL. I am new to javascript but am fairly decent at Java. The program only takes JS or VBS as scripting languages. My script is supposed to grab which camera filter the camera is currently using (got CCDCamera from their website) set it to a string, take it again 3 seconds later and set it to another string. then send it though a socket to the server.
I cant get the program to even run in command prompt because it opens and closes immediately. Any help on this would be great!
Sorry, I left your code open many hours ago and answered only now and didn't notice that you changed the link. Now your code is syntactically valid and I have no idea why it doesn't run. Maybe it's a problem with your environment.
Im using "1st javascript editor." ive ran it though command prompt and it closes instantly. Shouldnt it run for 3 seconds atleast?
No, if this is the full program, it with run and close instantly, because it has only variable and function declarations. The function getRawFilter calls setTimeout but it's never called itself.
If the host is localhost shouldn't it output whatever "changed" is to the command prompt? Do i need to call getRawFilter from another function in order for it to run?
Your program doesn't output anything. You declared 3 function but didn't call them. So the interpreter only wrote their code into memory but didn't execute them.
Quote:
Do i need to call getRawFilter from another function in order for it to run?
Your need to execute this statement
Code:
getRawFilter();
You can add it to the program. If you add it to another function which won't be called, this statement won't be executed either.
This script is being ran from inside another program which on their website says CCDCamera.FilterWheelName is the way to get the filter. Theres a pull down menu from where i can run this script inside of it, so would i even need to define CCDCamera?
On top of that, nowhere do you invoke the run function.
[/QUOTE]
how would i invoke the run function? I dont think making another function to call it would do anything since that would just be a never ending chain of invoking methods