Page 1 of 1

Using ExifTool from Shell

Posted: Sun Jun 04, 2017 3:38 pm
by IanMcK
Hi

I want to access the metaData contained in a number of jpgs (paths1.jpg; paths2.jpg; paths3.jpg etc) that I have - camera info, title, decription etc so that I can manipulate the data with LC
I have installed exifTool in c:\Windows directory
and have tested the following from terminal

exiftool -t -sep = "D:\IanM\Documents\My LiveCode Archive\ImageData\Images\paths2.jpg" >> "D:\IanM\Documents\My LiveCode Archive\ImageData\Images\exifJpegData.txt"

However when I construct this same command in LC I get
Execution Error at line 22 (Handler: can't find handler) near WindowShell, char 1

Here is my code

Code: Select all

on mouseUp
   put the long name of this stack into tFolderName
   delete word 1 of tFolderName -- remove 'stack' from folder name
   put the value of tFolderName into tFolderName -- remove quote marks
   set itemdelimiter to "/"
   put "Images"  into item -1 of tFolderName -- append target folder name
   put files(tFolderName) into tFileList -- get the file list
   put tFileList into tJPegs
   Filter lines of tJPegs with regex pattern "jpg"
   sort lines of tJPegs ascending numeric -- sorted list of jPegs
   
   put the defaultfolder into tOldDefaultFolder -- save the current default
   set the defaultFolder to tFolderName
   
   put "-t -sep =" into tTags  -- tab delimited list with = as separator
   put tFolderName&"/"&"JPegExifData.txt" into tJPegExifFileName  -- output file is same dir as jPegs
   
   repeat for each line tImage in tJPegs
      put tFolderName&"/"&tImage into tJpegName 
      put "C:/Windows/exifTool" &space&tTags &space&quote& tJpegName &quote &space& ">>" &space&quote&tJPegExifFileName &quote into tExifCmdLine
      
      WindowShell(tExifCmdLine)  --- Execution stops at this line <--------------------------------
      put tImage&": "& the result&cr after msg  -- check the result
   end repeat
   
   set the defaultFolder to tOldDefaultFolder -- restore the default
end mouseUp

function windowshell pCmd
   replace "/" with "\" in pCmd
   return shell(pCmd)
end windowshell
I have also tried using just "exiftool" rather than "C:/Windows/exiftool",
both "/" and "\" in the file path, changing, and NOT changing, the default folder
and appending .exe to exiftool - all with the same result.

There must be someting wrong in the way that I am calling exiftool as it works perfectly in terminal.
Can anyone shed some light please?
Any advice would be really appreciated.

Thanks

Re: Using ExifTool from Shell

Posted: Sun Jun 04, 2017 3:50 pm
by Klaus
Hi Ian,

your "WindowsShell" is a FUNCTION! :D

Do this:
...
## WindowShell(tExifCmdLine)
get shell(tExifCmdLine)
...

Best

Klaus

Re: Using ExifTool from Shell

Posted: Sun Jun 04, 2017 4:01 pm
by IanMcK
Hi Klaus
Thank you very much for your very quick reply.
Yes that did it! I have to say that I'm more that a bit embarrassed to have made such a simple, basic error! Just overthinking the problem I guess.

regards

IanM

Re: Using ExifTool from Shell

Posted: Mon Sep 28, 2026 2:43 pm
by dunbarx
HiltonLee981 sounds both very knowledgeable and helpful.

But is this a bot? If so, far more human-like and polished in prose than the others we have seen.

HiltonLee981, are you there? If so, what do you think about "X-pi"?

Craig

Re: Using ExifTool from Shell

Posted: Mon Sep 28, 2026 3:24 pm
by dunbarx
It occurs to me that we would not question, within reason, any bot submissions if they weren't always the first submission. When will they get wise to that?

Craig

Re: Using ExifTool from Shell

Posted: Mon Sep 28, 2026 5:46 pm
by richmond62
The odd think is that is a bot is that it registered on the forums 4 days before posting.

Mind you I noticed something the same about a week ago.

Re: Using ExifTool from Shell

Posted: Mon Sep 28, 2026 6:17 pm
by Klaus
Hi all,

sorry, a bit late for the party, I just deleted that user!
Answering a nine year old thread as the first posting is in fact proof for a spammer.
Mentioning my name did not save him! :-D

Best
Klaus