Slashdot Mirror


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?"

38 of 167 comments (clear)

  1. well there's the obvious by nocomment · · Score: 2, Insightful

    put linux on it.

    Or jsut make "Batch" files.

    --
    /* oops I accidentally made a comment, sorry */
    /* http://allyourbasearebelongto.us */
    1. Re:well there's the obvious by itwerx · · Score: 2, Informative

      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

    2. Re:well there's the obvious by aminorex · · Score: 2, Insightful

      Yeah, but there's no cron, no nfs, no umpteen zillion scriptable utility programs from "a2p" to "zip". You could install cygwin, though.
      That's close enough to Unix so that it's useful for automation tasks.

      --
      -I like my women like I like my tea: green-
    3. Re:well there's the obvious by Southpaw018 · · Score: 2, Insightful

      I use a combination of Cygwin, Windows Task Scheduler, cmd shell, and batch files to get the job done. It ain't pretty, but it works and it works well.

      --
      ACs are modded -6. I don't read you, I don't mod you, I don't see you. Don't like it? Don't be a coward.
  2. Batch files! by One+Div+Zero · · Score: 3, Informative

    I use batch files to operate a software level RAID solution! It's easy!

    RAID.bat
    xcopy c: d: /e /k /i /c

  3. Visual Basic for Applications (VBA) or Python by DamienMcKenna · · Score: 2, Informative

    VBA is the standard scripting language in Microsoft-land, or use Python with the Win32 stuff.

    Damien

    1. Re:Visual Basic for Applications (VBA) or Python by Cocteaustin · · Score: 3, Informative

      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.

  4. AutoIT by acaldwel · · Score: 4, Informative

    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

    1. Re:AutoIT by patro · · Score: 2, Informative

      Or AutHotkey. It's free (GPL) and very versatile.

  5. Old saying by MarkGriz · · Score: 3, Informative

    . 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.
    1. Re:Old saying by MarkGriz · · Score: 2, Insightful

      (replying to myself)

      Actually, on second thought, since he's paying YOU, maybe you should just keep quiet.

      I'm sure there are some horrendously complex ways to do what you want with XP which should generate loads of billable hours for you.

      --
      Beauty is in the eye of the beerholder.
  6. Windows Script by neura · · Score: 4, Informative
  7. GNU utilities for Win32 by arnie_apesacrappin · · Score: 3, Informative
    This project on source forge has native ports of many GNU utilities for windows. It includes a Z-shell. I have created many small automation projects with it and have had good results. I'm guessing you could use ZSH scripts as a manangement tool around the VBS or JS code.

    --

    Still, with a plan, you only get the best you can imagine. I'd always hoped for something better than that. -CP

  8. Python? by Grab · · Score: 3, Informative

    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.

  9. You're joking right? by Ahnteis · · Score: 4, Informative

    Nope, you're not. [sob]

    Windows Scripting

    Also happens to be the first result on Google for "windows scripting host".

  10. Re:Perl, etc. by Miros · · Score: 2, Insightful

    Dont forget PHP! PHP-cli is actually quite awesome for windows stuff, and if you can handle glade, you can even make some rapid efficient graphical apps. My only tip would be to avoid vbs like the plague.

  11. Python by frag+thief · · Score: 5, Insightful

    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.

  12. AutoIt with the great IDE by Futurepower(R) · · Score: 2, Insightful


    As someone else said, use AutoIt. AutoIt is by far the best open source software for automating Windows installs and other tasks in which the program pretends to be a user. There's an IDE with an Intellisense-like interface and a compiler. Be sure you get AutoIt with the SciTE IDE, the site is a little confusing.

    AutoHotkey came from the same source as AutoIt, is also open source, and is also impressive.

    --
    If your gov't chose killing as policy (CIA trained Arabs in 1980), expect others to choose the same.

  13. Photoshop scripting by anotherone · · Score: 4, Insightful

    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.
  14. Re:Good God by chris_mahan · · Score: 3, Informative

    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."

  15. Python = Yes! maybe w/ThumbsPlus? by Da+VinMan · · Score: 2, Informative

    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!
  16. How to install AutoIt by Futurepower(R) · · Score: 2, Informative


    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.

  17. Re:Jeeezus.... by snorklewacker · · Score: 2, Funny

    You're seriously suggesting a Mac Mini for pro photography work?

    Holy hell, it's like Mike Meyers in "All Things Scottish" whenever the subject of Macs comes up...

    --
    I am no longer wasting my time with slashdot
  18. Windows Scripting 101 by FriedTurkey · · Score: 4, Insightful

    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.

    1. Re:Windows Scripting 101 by the_seal · · Score: 4, Informative

      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

  19. Python + Win32CoM by Gopal.V · · Score: 4, Informative
    The last windows scripting I did was to convert a PHB excel spread sheet into a bugzilla report. It was converting the typical shared spread sheet on a folder share variety of bug reporting into proper bugzilla-like one (there are better ways, but it works).

    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/).

  20. Yay -- the story has come full circle by booch · · Score: 4, Insightful

    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.
    1. Re:Yay -- the story has come full circle by gbulmash · · Score: 2, Insightful
      The client isn't forcing the poster into using limited tools. He's just specified a platform. What the poster fails to mention is if the client is already running a Windows based shop and already has money invested in XP machines and software, which is probably why the client wants a Windows solution.

      What the poster *should* do is subcontract the bulk of the job to someone who knows how to do this in Windows and take a cut off the top instead of bitching about how the job would be so much better if he could operate in his own comfort zone.

      Sheesh.

  21. Re:Some problems cannot be solved by Umbral+Blot · · Score: 3, Funny

    have you considered exploiting integer over-flow?

  22. The question asked by fm6 · · Score: 2, Insightful
    For once, "Have you even heard of Google?" is not the correct response. The dude didn't ask "Can I script under windows", he asked "What's the best way to do scripting under windows." And that's a tricky question -- Windows is hardly the most scripting-friendly OS.

    Microsoft naturally comes out on top when you google for Windows scripting. But that doesn't mean that MS scripting technology is the best choice. On the contrary, Microsoft scripting relies heavily on their usual kludgey, baroque libraries and runtimes. I'm no expert, but if I were looking to do this sort of thing, I'd at least look at other scripting solutions for Windows. ActiveState is the obvious first place to look. There are many others.

  23. Easy remedy by Anonymous Coward · · Score: 2, Funny

    Buy a Mac mini, and conceal it in some hulking ATX case with a few lights on the front and some loud fans in the back.

    Then just do what you gotta do to make OS X look like Windows. He'll never know the difference. If he asks about it, tell him it's Longhorn.

  24. iMatch by jayrtfm · · Score: 2, Informative

    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.

  25. MacroExpress by SporkLand · · Score: 2, Interesting

    I have found Macro Express(http://www.macros.com/) to be the best way to script things under Windows. It lets you quickly write scripts that interact with various programs in the system to get useful things done. It even lets you get down to the level of sending messages to a Window's message handler, although I've never needed anything that complicated.

    It's only downside is that it is a bit timing sensitive, and is pseudo difficult to get synchronized with the programs it is interacting with in the absence of pop-up dialog boxes. I usually end-up throwing it into some busy-wait state where it checks to see if a specific sign of a tasks completion is in existence or not.

    The cool thing about it, is after the "customers" see what it can do, they tend to start working with it and even further automate their own workflow.

  26. Tcl and Tk by DavidNWelton · · Score: 2, Insightful

    Don't forget Tcl and Tk, either. Tcl is quite a capable language, once you get some extensions loaded (and it's nice and small too, because it doesn't make them built-ins). On Windows, ActiveTcl is a sensible proposal.

    As far as GUI's, Tk is still one of the best cross-platform things going out there. Especially when using the new Tile system.

  27. Gnuwin32 is a cygwin alternative. by hackwrench · · Score: 2, Informative

    Other replies to this post mention cygwin. Gnuwin32 has the benefit of using native Windows libraries.

    http://gnuwin32.sourceforge.net/

  28. KiXtart by Halvard · · Score: 4, Informative
    KiXtart is about the greatest thing since sliced bread. From the home page:

    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.

  29. FREE: Any UNIX utils you want OR WSH.... by Glasswire · · Score: 2, Informative
  30. Are you reinventing the wheel? by chriskenrick · · Score: 2, Insightful

    How "custom" are the requirements for this software? Keeping track of thousands and thousands of photos isn't a new problem, and there are heaps of programs around that do just that (eg IMatch, ACDSee, Fotostation, Portfolio). I'd be very surprised if this didn't work out more cost effectively than a custom solution.