Like jmunkki said, you should be able to do this with the automated scripting in S3D. Just add the following to your post-processing script
{REPLACE "; inner perimeter" "M106 S255\n; inner perimeter"}
{REPLACE "; outer perimeter" "M106 S255\n; outer perimeter"}
{REPLACE "; infill" "M106 S0\n; infill"}
That should turn the fan on for your perimeters, but then off for the infill which is printed right after the perimeters.
If you're new to these commands, here's a few good links to help:
https://www.simplify3d.com/support/arti ... -tutorial/
viewtopic.php?f=8&t=1959