Using ExifTool from Shell
Posted: Sun Jun 04, 2017 3:38 pm
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
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
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"e& tJpegName "e &space& ">>" &space"e&tJPegExifFileName "e 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
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