What's the Best Way to Handle Scripting Under XP? 167
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?"
well there's the obvious (Score:3, Insightful)
Or jsut make "Batch" files.
Re:well there's the obvious (Score:2)
Re:well there's the obvious (Score:3, Informative)
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 [gimp.org]
Re:well there's the obvious (Score:2)
Re:well there's the obvious (Score:2)
Re:well there's the obvious (Score:2)
Re:well there's the obvious (Score:3, Insightful)
That's close enough to Unix so that it's useful for automation tasks.
Re:well there's the obvious (Score:2)
I imagine it all very AWKward (pun intended) on windows though.
Re:well there's the obvious (Score:3, Insightful)
Re:well there's the obvious (Score:2)
Re:Multitasking? (Score:2)
Well, I doubt if it's much extra overhead given the number of services started by default, I normally kill a few. Anyway -
Exactly - just run cron. The Windows Task Scheduler can be switched off.
Re:well there's the obvious (Score:2)
It's not as rich as UNIX, but it's capable. I just wrote a very large distributed cluster application in NT Shell, albeit painfully.
FREE: Any UNIX utils you want OR WSH.... (Score:3, Informative)
1) Windows Services for UNIX [microsoft.com]
2) Windows Scripting Host [microsoft.com]
Re:well there's the obvious (Score:2)
Well, put Cygwin on his MS-Windows box. Write bash scripts. Done right, your cuustomer will never even notice Cygwin, and you'll have access to everything you need to automate his workflow.
Re:well there's the obvious (Score:2)
Gnuwin32 is a cygwin alternative. (Score:2, Informative)
http://gnuwin32.sourceforge.net/ [sourceforge.net]
Perl, etc. (Score:2)
I just loaded ImageMagick and sed on a peecee running W2K for my current gig and put a little
If the script wants to do a lot of logic, then Perl, Python, and that ilk may be more to your liking.
Mark
Re:Perl, etc. (Score:2, Insightful)
Re:Perl, etc. (Score:2)
Tcl and Tk (Score:3, Insightful)
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.
Cygwin dude... (Score:2)
Of course, it could be pain when you have spaces in your file names.
Batch files! (Score:3, Informative)
RAID.bat
xcopy c: d:
Visual Basic for Applications (VBA) or Python (Score:3, Informative)
Damien
Python = Yes! maybe w/ThumbsPlus? (Score:3, Informative)
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 [cerious.com]). You can probably also use this from Python with Win32 extensions.
You know, you can still have fun putting solutions together un
Re:Visual Basic for Applications (VBA) or Python (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 probab
AutoIT (Score:4, Informative)
-Adam
Re:AutoIT (Score:1)
Re:AutoIT (Score:2, Informative)
Re:AutoIT (Score:2)
Old saying (Score:4, Informative)
Perhaps you could explain to him the meaning of being "Penny wise, Pound foolish"
Re:Old saying (Score:3, Insightful)
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.
No kidding (Score:2)
On the other hand, if one is knowledgeable, it is very possible to write VBScript or JScript scripts with just a text editor. Those can drive Photoshop and iView Pro, and can talk ftp as well. I guess I shouldn't be too surprised at the submitter's ignorance, given the number of people suggesting batch files (yuck!).
If VBScript and JScript don't turn your crank, then it is quite po
Re:No kidding (Score:2)
Windows Script (Score:4, Informative)
Re:Windows Script (Score:2)
This is a good suggestion. You can use JScript or VBScript, usually without installing anything on the Windows PC, unless they have a really old system.
You can also use JScript in Microsoft.NET. The compilers for C#, JScript, and VB.NET are included when you download the .NET framework, which is free.
Look in c:\Windows\Microsoft.NET\Framework\version for CSC.EXE, JSC.EXE, and VBC.EXE. You may already have them.
GNU utilities for Win32 (Score:4, Informative)
Monad (Score:1)
Python? (Score:4, Informative)
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/ [sourceforge.com] is worth a look.
Grab.
Re:Python? (Score:2)
Re:Python? (Score:2)
And if you provide a GUI, for gods sake don't do it with Tkinter, or anything that builds on top of it. It's like stabbing yourself in the balls. Use wxPython, or PythonCard, or Wax, or (if you can pay the license fees) PyQt. Not Tkinter. Ever.
Macro Express (Score:2)
Depends on the workflow (Score:1)
If a really complex workflow is needed, why not try using Ant? It's not just a build tool (look at the list of tasks that come with it, specifically FTP) .
Re:Depends on the workflow (Score:1)
Advice (Score:2)
Re:Advice (Score:2)
I mean, obviously you have to put food on the table, but I wouldn't exactly put in loads of extra hours and go the extra mile if it looks like you're going to get nothing in return for it. Do the job, use something adequate, collect your bill, job over. Then when he wants more, you can bill it as another j
Re:Advice (Score:2)
If only it were that easy.
Re:Advice (Score:2)
It sounds like all he is doing is importing a bunch of photos into photoshop and exporting them out of ftp. Photoshop can do most of this with batch processing already and anything you can't do with photoshop natively you can use windows scripting to do.
Pretending that using a Mac is the only way of doing something is just ignoran
Re:Advice (Score:2)
Re:Advice (Score:2)
If I guy comes to me asking for a solution on a Mac... you know what I tell him?
Go talk to alienw, because it's going to take me longer to get up to speed on how to do it than it will take him to just do it.
You're joking right? (Score:5, Informative)
Windows Scripting [microsoft.com]
Also happens to be the first result on Google for "windows scripting host".
The question asked (Score:3, Insightful)
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
Re:The question asked (Score:2)
The biggest issue is that you don't get as many little tools as you would with a Unix OS, but for a single installation, that's not that big of a deal.
Re:The question asked (Score:2)
Re:The question asked (Score:2)
Re:You're joking right? (Score:2)
The only useful thing WSH can do is mess with COM objects, which is kinda useless by itself.
Python (Score:5, Insightful)
Re:Python (Score:2)
Cygwin + GUI Apps + bash or python + DCOP
The above should make for a potent combination allowing for scriptable applications, and the user would still think they're using Windows stuff.
AutoIt with the great IDE (Score:3, Insightful)
As someone else said, use AutoIt. AutoIt [autoitscript.com] 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 [autoitscript.com], the site is a little confusing.
AutoHotkey [autohotkey.com] 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.
Re:AutoIt with the great IDE (Score:2)
How to install AutoIt (Score:3, 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.
Get a Mac (Score:1, Troll)
Photoshop scripting (Score:5, Insightful)
Some problems cannot be solved (Score:2)
Solvable:
Problem: I need to add a number to 7 to get 6. What number should I use?
Answer: Use the number -1. 7 + -1 = 6.
Unsolvable:
Problem: I need to add a positive number to 7 to get 6. What number should I use?
Answer: Find another client.
Many times I see a customer choose something cheap to save money, only to find it costs them more to learn, maintain, and use that solution that it
Re:Some problems cannot be solved (Score:4, Funny)
Re:Some problems cannot be solved (Score:2)
*Unfortunately, working in my office also requires fluency in Japanese sufficient to explain why that joke is funny.
Re:Some problems cannot be solved (Score:2)
Jeeezus.... (Score:2)
Re:Jeeezus.... (Score:3, Funny)
Holy hell, it's like Mike Meyers in "All Things Scottish" whenever the subject of Macs comes up...
Re:Jeeezus.... (Score:2)
Seriously, I just read the summary: 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.
... and suggested that he tells his boss what he wants.
Macs are pretty nifty little machines, and the Mac Mini is probably underpowered for Photoshop, depending on what you want to do. But if it does what he wants, why not use it?
Re:Jeeezus.... (Score:2)
Now, for the original question: do you have your own portable Mac? Demonstrate to your boss that everything h
Mini Mac ? (Score:1)
Ask Slashdot always boils down to the same thing : How can I do something expensive for nothing with no willpower and/or skill.
There is no such thing as a free lunch.
Re:Mini Mac ? (Score:2)
Windows Scripting 101 (Score:5, Insightful)
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.
Re:Windows Scripting 101 (Score:4, Informative)
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/ [microsoft.com]
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 [w3schools.com]
http://www.ss64.com/wsh/functions.html [ss64.com]
Re:Windows Scripting 101 (Score:2)
If your looking to get a little more platform independant, elegant, and powerfull, but keep it easy, I suggest you take a look at Python.
Python + Win32CoM (Score:5, Informative)
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 [oreillynet.com] 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/).
Yay -- the story has come full circle (Score:5, Insightful)
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.
Re:Yay -- the story has come full circle (Score:2)
Exactly whats being created here isn't perfectly clear, of course, but based on the description of the OPs preferred solution, I see no reason anyone competent couldn't implem
Re:Yay -- the story has come full circle (Score:3, Insightful)
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 c
Re:Yay -- the story has come full circle (Score:2)
I did tell the poster to factor in the cost of the Mac into the equation, and see if it actually came out better for the client to build it for the PC.
Sheesh.
Easy remedy (Score:2, Funny)
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.
I use Ruby. (Score:2)
It works very well. There is an interpreter for Win32.
Look here [ruby-lang.org]
I use javascript (Score:2)
Irfanview has command line parameters for most of its features, which makes it useful for image manipulation.
For ftp, you could try outputting your commands to a text file then running the ftp.exe that comes with windows on it.
If you need a great deal more, a full cygwin install will give you almost every tool you'd ever want
Ruby and ImageMagic (Score:2)
iMatch (Score:3, Informative)
The programmer is very responsive and active on the user forum.
Not sure what you intend, but... (Score:2)
Windows is easily scripted using Windows Scripting Host. You can use Jscript, VBScript, and other third party languages. If all you are trying to do is automate some processing on a directory of files, move some files around, maybe create a directory structure... whatever. That's the way to do it. You can setup little icons to click and it runs the process, or schedule them to run, whatever.
But if you
File System Object (Score:2)
MacroExpress (Score:2, Interesting)
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 abse
WinBatch (Score:2)
Plus, there are a zillion forum postings so odds are if you're trying to figure out how to do something odd, someone else has taken a stab at it.
Or you could just use Perl.
Trick him into getting a Mac (Score:2)
perl, make, NetPBM, ImageMagick, ... (Score:2)
- Hubert
KiXtart (Score:5, Informative)
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.
Other considerations (Score:2)
There have been many scripting suggestions given. Before selecting one, you may wish to identify some other items first.
Does your workflow need to be a GUI application? Can it be a set of console applications? Can it be a web based application? I currently work with a system that scans and scores school assessment test documents. The section I work with, the input side, tracks the document workflow with an Oracle backed web application. How you intend to manage the workflow of the images may have an
DeBabelizer? (Score:2)
Rexx (Score:2)
Are you reinventing the wheel? (Score:3, Insightful)
Perl + Cygwin. Konfabulator? (Score:2)
http://cygwin.com/ [cygwin.com]
You could use a move native Perl like ActiPerl.
Recently, I played around with the Perl Win32 libraries. They do the usual API access, but one of them (forget which) lets you simulate keyclicks. There's a sample program on the web somewhere that has a 5-line Perl script launching Excel, and enter data in Excel cells.
What I like to see: a scripting engine with a Konfabulator like UI. Konfabulator isn't open-source, but I would like a client-side scripting engin
Re:Good God (Score:3, Informative)
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.
Macs??? (Score:1)
Re:Macs??? (Score:2)
Now, if you were a big house with tens of thousands of dollars invested in software, this was an incentive to stay the Mac course. But if you were a new house or an indie who