Press the flag and the cat will go to the apple. Click to place a scratch cat and it will follow the path to the apple. Only place the scratch cat on an arrow tile, or it will have nothing to follow.
thank you @griffpatch for the tutorial. I copied some of his scripts but decided to try to make the rest on my own. it's probably not as good.