I can run your script from Geany now.
The shebang looked like this #!/usr/bin python but my system liked it like #!/usr/bin/python (without space)
In Geany I was still getting "invalid working directory" with the %d/%f so I took your suggestion and moved in
in with the command. Then it all worked.
Thanks again for all your help Robin.