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:
VBA is the standard scripting language in Microsoft-land, or use Python with the Win32 stuff.
Damien
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".
I hate replying to myself
:)
I hate replying to you too!
[rimshot]
(No offense intended, just couldn't resist the straight line!
Back on topic - I would agree that Linux probably is the best answer. However, there are various freeware/shareware apps for image editing under Windows that are scriptable. E.g. our faithful friend Gimp
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."
I've done this myself. In my case, it was to automate a job that queried a SQL Server and synchronized a file system with the database (think VERY crude content management here) using Python 2.3. os.walk() is your friend! :+)
If you need to do image manipulation too, then you might also want to check out a tool like ThumbsPlus Commander (http://www.cerious.com/tpcommand.shtml). You can probably also use this from Python with Win32 extensions.
You know, you can still have fun putting solutions together under Windows. It doesn't have to be a bad experience just because it's not OS X.
Best of luck!
Please mod this post only if you think others should/n't read this. I have enough ego^H^H^Hkarma. Thanks!
One tip about AutoIt: Install the latest version of AutoIt. Then install the version of SciTE that includes AutoIt. We have found that just installing SciTE with AutoIt gives error messages.
The web site is a little bit confusing, but the AutoIt help messages are quite clear.
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
Seconded.
My only "programming" experience was some light VBA, I was able to pick up VBS in no time, mostly using Microsoft's site and help file http://msdn.microsoft.com/scripting/
There are also site's out there with plenty of code ready for use and a buttload of books.
http://www.w3schools.com/vbscript/default.asp
http://www.ss64.com/wsh/functions.html
iMatch has a basic language scripting built in, can control other programs, can handle RAW, hundreds of thousands of images in its database, simple image editing, yada yada yada..... it's a mature app.
The programmer is very responsive and active on the user forum.
Other replies to this post mention cygwin. Gnuwin32 has the benefit of using native Windows libraries.
http://gnuwin32.sourceforge.net/
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.
Check out
1) Windows Services for UNIX
2) Windows Scripting Host