### using sage engine during compilation of tex file

I would like to automate calling sage after compiling a tex file in TeXShop. I have copied the ~~sage.engine ~~`sage.engine`

file from ~~~/Library/TeXShop/Engines/Inactive/Sage ~~`~/Library/TeXShop/Engines/Inactive/Sage`

to ~~~/Library/TeXShop/Engines/ ~~`~/Library/TeXShop/Engines/`

and followed the instructions in

`About `~~Sage.pdf. ~~Sage.pdf

.

I've included the line

`% !TEX TS-program = `~~sage ~~sage

in my tex file, but when I compile the file the sage expressions don't compute. I only get ~~?? ~~`??`

for sage expressions. If I run sage on the sagetex.sage file and re-compile the tex file, then everything looks good.

I'm running TeXShop 3.75 on MacOS 10.10.5