What's the Best Way to Handle Scripting Under XP?
ChrisZermatt asks: "I've got to build a custom workflow for a customer that has a photography business. His photographers take hundreds of thousands of photos a year, and since he's recently moved entirely to digital, he wants to automate a lot of his current processes. Ideally I'd be able to plonk a recent Mac running Tiger into his shop, and use a combination of AppleScript, iView
Pro, Photoshop and an FTP program to handle all his needs. Sadly, he insists on using *cheap* PC's running Windows, so a Mac isn't an option for this project. So, what should I use on the Windows side of things to build a custom workflow?"
"iView lets you control the program using VBS or Javascript, but they don't really offer much in the way of advice on building a Windows workflow. I need to be able to copy/move a ton of files around and link the above mentioned programs. I'd really rather *not* spend money on something like VisualBasic. What are the alternatives for scripting on Windows?"
I use batch files to operate a software level RAID solution! It's easy!
/e /k /i /c
RAID.bat
xcopy c: d:
Take a look at http://www.autoitscript.com/autoit3/. It can automate windows GUIs and you can convert your scripts to .EXE files for easy of deployment.
-Adam
. Ideally I'd be able to plonk a recent Mac running Tiger into his shop, and use a combination of AppleScript, iView Pro, Photoshop and an FTP program to handle all his needs. Sadly, he insists on using *cheap* PC's running Windows, so a Mac isn't an option for this project.
Perhaps you could explain to him the meaning of being "Penny wise, Pound foolish"
Beauty is in the eye of the beerholder.
http://msdn.microsoft.com/scripting/
Still, with a plan, you only get the best you can imagine. I'd always hoped for something better than that. -CP
Depends on the processes. However if what you're after is something to take in a bunch of files, call a command-line program (or programs) to munge them in some way, and spit them out elsewhere, Python isn't a bad tool for connecting the dots. It's not blindingly fast itself, but if you're just using it for scripting then no problems there.
Python's default GUI provision is a bit basic though. If you want to build a Python user interface quickly, the PMW widget set (http://pmw.sourceforge.com/ is worth a look.
Grab.
Nope, you're not. [sob]
Windows Scripting
Also happens to be the first result on Google for "windows scripting host".
If it was me, I'd do it all in Python. It even has FTP libs built in. Plus, when you're ready to dump the Windows boxes you can run the same Python scripts or Linux or a Mac.
Don't underestimate the power of Photoshop's scripting. I also do some work for a photographer and between actions and photoshop scripts, just about everything except some of the actual art is automated.
Username taken, please choose another one.
No need for cygwin. Python runs fine under xp.
Of note: python try: except: construct works much better than vbs' on error. Trust me.
You can even py2exe to make them windows executables.
also, with pythonwin, you can use com objects from python, and update things in mssql or ms access.
yes, i've done this. It works great.
"Piter, too, is dead."
VBA is actually not used to write scripts. It's used as an embedded automation/macro language in applications like Office and it is the language engine behind VB6. You can't write VBA code and have it run on the desktop by itself, that's why they call it "Visual Basic for Applications."
The scripting engine on Windows is called Windows Script Host and it runs VBScript (different than VBA) and JavaScript (as well as other languages; it's pluggable) on the desktop.
That said, if I had to do this, I'd probably use Python.
If you want to appease the /. crowd you should install a bunch of open source tools. If your not a zealot, you should just use Windows Scripting Host which is already installed on an XP machine. Here is a three step example to get you started.
1. Open up notepad
2. Create a file with a vbs extension like "test.vbs".
3. Save the following text:
MsgBox "test"
Now just click on the file in Windows Explorer. There are whole websites to using VBScript.
I don't care about Mod points or I would of just said use some open source tool. I use open source tools all the time when it is the right tool for the job.
More over I like python - it has win32com which is damn easy to use, at least with Excel objects. Writing the script took me less than a day, while entering the bugs manually would have taken me over a week (imagine 2200 bugs of varying severity, and descriptions). The real challenge was to convert the OLE objects into attachements (screenshots, logs..). Truly they were idiots for maintaining all this in a SINGLE EXCEL File !!.
But the point being, python+win32com is as easy as any other windows scripting host. Looks like there's python support for Photoshop as well.Python is an average general purpose language. It's not fast like C++, doesn't have something like CPAN , nor is it very complicated or interesting. But it is often easy to write, read and throw away (or upload to your hacks/).
Quidquid latine dictum sit, altum videtur
Well, half circle, I guess.
Here's a parable (story) I once heard, which seems rather fitting. It's about offering to give the customer what they want, but making it clear what it will cost when they want something that's not to their benefit.
A consultant was writing a custom application for a company. The program was written to work on a PC. One of the executives at the company used a Mac, so he insisted that they make the program work on his Mac. The consultant says "sure, we can do that". The consulant comes back with an estimate on the cost of making the program work on the Mac: $50,000 and 6 months. The executive decided to use a PC.
So my advice to you is this: provide the guy with 2 estimates -- one for your Mac solution, and one for a solution using the limited tools he's forcing you to use. Don't forget to factor in the Mac hardware costs, your research time, the extra time it will take to work with tools you are not familiar with, and perhaps a premium for working with tools you don't like. Maybe the difference will change his mind; maybe it will change yours.
Software sucks. Open Source sucks less.
have you considered exploiting integer over-flow?
Philosophy.
What's KiXtart
The KiXtart free-format scripting language has rich built-in functionality for easy scripting. It also supports COM (providing access to ADSI, ADO, WMI, etc) and thus is easily extensible. With the amazing KiXforms GUI for KiXtart, there is so little, if anything you can't accomplish with KiXtart.
And because of the User Defined Functions (about 500 ready UDF's on korg already), there is very little you need to code by yourself as much of the complex things have already been coded for you!
KiXtart is developed by Ruud van Velsen of Microsoft Netherlands
KiXtart is now provided to you as CareWare. Please see "KiXtart: Do You Care?" for full details.
It's pretty incredible, it's free, it allows you to do things you can't otherwise do at login with paying a lot of money (and did it sooner I believe), is written by an MS employee.