Pass fille path in Shell Script

I am trying to run a shell script on an external application but I get the error
Invalid file or directory path:
How do I pass the file path onto an application. I have tried the below

#The last argument given to a script is the last known path of the image Retrobatch is passing to it.
imagePath=“${@: -1}”
/Applications/Topaz\ Photo\\ Photo\ AI --cli --overwrite “$imagePath”

If you add something like:

echo "$imagePath" >> /tmp/path_info.txt

before you call the Topaz tool, what’s the path that is is showing up in the /tmp/path_info.txt file?

The file /tmp/path_info.txt is blank when I add this in. I get this message from the log window

Checking if log directory should be pruned. Currently have 11 log files.
Number of logs exceeds max number to keep ( 10 ). Cleaning excess logs.
QObject::moveToThread: Cannot move objects with a parent
Logger initialized
[CLI] Invalid file or directory path:
Error | Attempted to set index out of range: 0 images loaded, but setting index to 0
No valid image files passed

It sounds like Topaz Photo AI isn’t getting any files passed to it (and the logging info stuff is from it, not Retrobatch).

Do you have the Run at: argument set to “Every Image” in the Shell node properties?