You are not logged in.

#1 26 Aug 2007 00:02

Michael Lee
Member
Registered: 25 Aug 2007
Posts: 1

Nesting "For" Loops

I hope I'm in the correct forum to ask this question.

I (think) I am trying to nest "for" loops and I can't for the life of me get it to work.

Here is a simple batch file I am trying to write:

@echo off
for %%i in (%*) do (
exiftool.exe "-Composite:GPSPosition>FILE:comment" -overwrite_original %%i
jdatestamp -datefmt @c -x -80x -y -80x -pointsize 30x -color 255:255:0 -outfile @d@p-gps.jpg
)

I want to drop jpeg files onto the batch file and have exiftool do its thing and then jdatestamp do its thing, to the same files.
Either the exiftool line or jdatestamp line work fine individually, but when combined (nested) the second line, the jdatestamp line, doesn't execute.

I believe that my syntax may be just a little "off".  Any and all input is much appreciated.

Mike

Offline

#2 28 Aug 2007 21:48

Simon Sheppard
Admin
Registered: 27 Aug 2005
Posts: 1,130
Website

Re: Nesting "For" Loops

The two commands are probably locking the files, make the batch script wait and do one at a time like this:

start /wait exiftool.exe "-Composite:GPSPosition>FILE:comment" -overwrite_original %%i
start /wait jdatestamp -datefmt @c - ... etc

Offline

#3 03 Sep 2007 09:39

bluesxman
Member
From: UK
Registered: 29 Dec 2006
Posts: 1,129

Re: Nesting "For" Loops

Whilst Simon has a very good point, I don't see anywhere that you're telling "jdatestamp" to work with file "%%I" ... surely it should be?  All I see is a hard-coded output file at the end of the "jdatestamp" line.


cmd | *sh | ruby | chef

Offline

Board footer

Powered by