News:

2023-08-10 - ExifTool version 12.65 released

Main Menu

Returning a value

Started by Archive, May 12, 2010, 08:54:03 AM

Previous topic - Next topic

Archive

[Originally posted by johnbeardy on 2007-04-15 09:18:32-07]

OK, I may be showing up my lack of knowledge of command lines, but... can I only return to VB a boolean value?.

Coding in VB, with "-xmp-xmp:Label -b -k" I can see that exiftools is seeing the correct tag value "Yellow" in the command line window but all I seem to be able to return is a 1 or 0 value. Any thoughts/help?

John

       Set Wshshell = CreateObject("wscript.shell")

       retcode = Wshshell.Run(dngCommandLine, 1, True)

       Debug.Print retcode

Archive

[Originally posted by exiftool on 2007-04-15 11:40:47-07]

The return code indicates only success or failure of the command.

What you need to do is capture the console output of the command
to return the value of a tag.  I don't know how to do this in VB, but
it is an easy thing to do in C or scripting language in Unix.

Also, you probably don't want to use the -k option here, because it waits
for keyboard input which doesn't make sense from within a VB script.

- Phil

Archive

[Originally posted by johnbeardy on 2007-04-15 12:07:03-07]

Thanks Phil, I'll follow that up. C? Eek, that's real programming isn't it?

John