scripting

From a script call a function in .js file

I have this in a test.html: <script> function h(){ g(); } <script> k.js has: g(); In test.html I successfully entered h() but not g(). I added k.js as a script tag: scriptTag.src="k.js" It is not finding g() just the same. What am I doing wrong? ...

Where to find wscript hooks?

I need to automate an IM client to update a status every few hours, basically log in, update status, log out. I'm trying to do this with windows scripting, but cannot seem to find the proper hook names to the application. Is there somewhere specific I can look to find this kind of information about an application, or am I merely going ...

How to start and position multiple applications on Ubuntu/Linux?

At my new job I am doing rails development and I am on Ubuntu (my choice). I want to start up emacs, and 2 or 3 terminals, position them, and possibly cd to directories. I have been looking all over but can't seem to find any application which will do this. I am asking this here, because if there isn't an app somebody knows about, it w...

Advice for Windows system scripting+programming

I just got a project where I have to do the following on a Windows OS: detect how many drives (C: D: E: ..etc) are connected to current system what the system labels are for each volume how much storage (both used and free) for each of the drives what format each drive is (NTFS/FAT32) how many files are in a given directory in any o...

performance questions on dynamically loading Javascript Objects

Which is faster, Using an XMLHTTP Get request and than using eval() for the reponsetext Using the JSONP technique for loading a script and then evaling the innerHtml of the script. Dynamically adding a script tag to the head of a document where the javascript object is being assigned to a variable? My gut tells me this should be opt...

Piping Batch File output to a Python script

I'm trying to write a python script (in windows) that runs a batch file and will take the command line output of that batch file as input. The batch file runs processes that I don't have access to and gives output based on whether those processes are successful. I'd like to take those messages from the batch file and use them in the pyth...

Connecting to SQLCE from windows scripting host on a Win32 platform

Is it possible to connect to SQLCE on a Win32 platform using Windows scripting host? I've tried using the ADODB.Connection activeX object to no avail. ...

can Ruby get the filenames in a folder if they have Unicode characters (on Windows Vista)?

i was writing a script on Windows Vista to move the files in a folder to another hard drive, but found that Ruby 1.8.6 or 1.9 both would get back filenames with Unicode characters in it replaced by "??????" so for example, the filename "Chart for ???????.doc" is returned so the file cannot be moved at all... i used filename.each_byt...

Set instant messenger display message programmatically

Would a script that sets display messages for instant messengers be simple or complex? After some searching, there doesn't seem to be any information about this at all. For the sake of an example, if I had a text file of quotations, would it be possible to have the google talk display message change to a different quotation hourly? ...

Does Vista Voice Recognition engine have scripting like Naturally Speaking?

Title says it all. I want to have an action performed whenever the user (while using Vista voice recognition) says "Wingbats are crazy!". How do I do this? Is there scripting or is there a dll to tie into? ...

Getting sed to Replace Text With Argument

Alright, I know this is a simple question, but I can't seem to get this sed command to work. I'm trying to get a text file and replace one bit of it from placeholder text to a study code. The study code that it is going to replace it with is passed into the script using arguments when the script is first ran. The problem is, when I tr...

should I avoid the 'dir' alias in Powershell scripts?

The powershell guidelines suggest avoiding the use of aliases in scripts, e.g. spelling out Get-Content instead of using gc, and using Foreach-Object instead of %. For the most part I think this is good advice, but I'm having a hard time following it with the dir alias, at least when used with the filesystem (vs. the registry or such). ...

How to read from a text file using VBScript?

I am looking to see a simple way to read from and write to a text file using VBScript. I think this is an acceptable method for writing to a file. Dim f, Dim fso Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.CreateTextFile("C:\test.txt", True, True) f.WriteLine("Data to Add to file.") f.Close However, I wo...

Can I start a script so it's independent of its parent process on Linux?

Is there a way to start a script from another process, so that if the process dies/ends, the script still continues? Will setuid do this? If I were to set the owner to root, and then start the script? For example, if I have some PHP code starting a script, but httpd dies or gets killed, I think that it takes my script with it. Is the...

How do I search an ActiveX/COM object for a method?

I have an ActiveX/COM DLL. It contains many methods and properties. I would like to be able to ask it if it has a particular symbol, as per the following snippet: If HasMethod( "StdLib.DLL", "ReadFileE" ) Then ... End If Is there a way to do this from, say, VBScript or JScript? If not, where do I go to get the information I need? ...

Functionality Scripts

Is it possible to write a program to do things you constantly do on a computer? For example, log into a torrent site and download a .torrent file then start it. Or go through folders and extract any RARed files? Or just do any monotonous thing you do daily on a computer. Just need a kick in the right direction. Thanks, -Pete ...

Is there a "safe" subset of Python for use as an embedded scripting language?

In the many Python applications I've created, I often create simple modules containing nothing but constants to be used as config files. Additionally, because the config file is actually a Python code file, I can add simple logic for changing variables depending on a debug level, etc. While this works great for internal applications, I...

How can I end a Lua thread cleanly?

My situation is that I'm using the Lua (C) API to execute a script held in a string. I would like the user to be able to terminate the execution of the script (this is essential if the script contains an infinite loop), how can I do this? lua_State *Lua = lua_open(); char * code; // Initialisation code luaL_dostring(L, code); ...

How do I extend a 3Ds Max material correctly

...

Call another program's functions?

So I have this program that I really like, and it doesn't support Applescript. I'd like to automate it a little bit. Now, I know that I could use applescript to tell the program to tell the menu to tell the submenu to tell the menuitem to activate or whatever, but frankly I don't like applescript very much anyway. When I open the NIB fi...