Many thanks for all that. It is a much more elegant solution.
As mentioned, I don't understand XML files. So, I don't know where or how to add "variables" to the wflow file. I could use System Events to add a new plist item to the file but, I don't know where in the structure to put it so that it is not overwritten by Automator when I edit and save the AppleScript.
Anyway, I tried to just shove in a new key called "variables" using a text editor. Now Automator can't open the Service at all or it just hangs and I have to force quit it. So, I clearly have no idea of what I'm doing.
As an aside, the wflow file has this section:
on run {input, parameters}
(* Your script goes here *)
return input
end run
But my AS code isn't there. It's located under "ActionParameters", "source". My AS code is in a logical place as it is run by the "Run AppleScript" action. But, what is expected to go in the "on run" section ?
Cheers.