I doubt that the flatworms are bothering the anemone. Start siphoning them out. Start a siphon with a powerhead and run a tube into a filter sock, catching the water in a bucket. Return the water when done, keep repeating.
Flatworm exit itself is not toxic. However, the flatworms will release toxins when they die. So it is very important to get as much as you can out before you use the flatworm exit. You will want to have carbon ready to run and also have water change water ready to go. I recommend watching your tank for 6+ hours after you dose.
When this happened to me, I siphoned as much as I could, then I removed a bunch of the rock and treated in buckets seperately, with a powerhead in the buckets. I also treated the tank at the same time.