Hello,
I have a AppleScript (see below) in Hazel which uses ExifTool to generate PDF keywords from existing PDF comments. This Script works fine under Yosemite, but don't work under El Capitan.
In several posts it has recommended to add the path to ExifTool. So I have changed the code "exiftool -keywords " & myPosixPath" to "/usr/local/bin/exiftool -keywords " & myPosixPath, but it doesn't work. Perhaps I have to change other Paths settings (myPosixPath)?
Any suggestions?
tell application "Finder" to set Thecomment to comment of theFile
set myPosixPath to quoted form of POSIX path of theFile
set oldkeywords to do shell script "/usr/local/bin/exiftool -keywords " & myPosixPath
set oldDelimiters to AppleScript's text item delimiters
set {tid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ":"}
set Keywordstring to ""
try
set oldkeywords to text 2 thru -1 of text item 2 of oldkeywords
set AppleScript's text item delimiters to ", "
set oldkeywords to text items of oldkeywords
repeat with i from 1 to count of oldkeywords
set theKEYWORD to quoted form of item i of oldkeywords
if (count of theKEYWORD) < 66 then
set theKEYWORD to " -keywords=" & theKEYWORD
set Keywordstring to Keywordstring & theKEYWORD
else
display dialog "keyword zu lang: " & theKEYWORD giving up after 5
end if
end repeat
end try
try
set AppleScript's text item delimiters to ";"
set newkeywords to text items of Thecomment
repeat with i from 1 to count of newkeywords
set theKEYWORD to quoted form of item i of newkeywords
if (count of theKEYWORD) is not greater than 66 and (count of theKEYWORD) is not equal to 2 then
set theKEYWORD to " -keywords=" & theKEYWORD
set Keywordstring to Keywordstring & theKEYWORD
else
display dialog "Problem mit keyword: " & theKEYWORD giving up after 5
end if
end repeat
end try
set tid to AppleScript's text item delimiters
do shell script "exiftool" & Keywordstring & " " & myPosixPath
Are you calling exiftool for a second time on the last line? Try putting the full path there as well.
Hi,
Thank you very much for your response!
I have put now the full path on the last line, et voilĂ , exiftool is working fine! ;D