This is what I cannot understand.
I thought that my code below sets SelectedFile to the path of the selected image, but when I add +SelectedFile to the end of my command line, it compiles but does not do anything to the image file???
[code]Dim jpegType As New FileType
jpegType.Name = “image/jpeg”
jpegType.MacType = “JPEG”
jpegType.MacCreator = “prvw”
jpegType.Extensions = “jpg;jpeg”
Dim pngType As New FileType
pngType.Name = “image/png”
pngType.MacType = "PNG "
pngType.MacCreator = “ogle”
pngType.Extensions = “png”
You have to use ShellPath for shell commands, not AbsolutePath.
ShellPath and AbsolutePath are properties of FolderItem, so you won’t be able to use it on the SelectedFile string.
Change file.AbsolutePath to file.ShellPath and see if that helps.
Dim sh as New Shell
sh.execute “exiftool -overwrite_original -copyright=‘Richard Summers’” + SelectedFile
sh.close
End If[/code]
And with all due respect, not everyone is a natural developer, and some of us have trouble understanding certain concepts.
I probably use Xojo for one or two days a year, therefore, when someone says “The Language Reference is your Friend”, it often does not help in the slightest if you cannot understand the LR.
My understanding of my code is:
SelectedFile is a string, and that string obtains the shell path of the chosen file (as a string). I am then using + SelectedFile in my command line, to set the file to be worked on.
Richard you should try setting up your shell execute line in a string so you can debug it.
You can pause execution, copy the string variable contents to the clipboard, and attempt the shell command in Terminal.
You may be missing a space after setting the copyright option and before the file path.
Value 127 is returned by /bin/sh when the given command is not found within your PATH system variable and it is not a built-in shell command. In other words, the system doesn’t understand your command, because it doesn’t know where to find the binary you’re trying to call.