Hey CP, long time no 'c'
To get AI to do exactly what you tell them to, you need to check the "No Dynamic Goals" box (also known as Disable Self-preservation Instinct) in the Misc properties of the ships. Without doing this, no matter what their orders are, and particularly with attack orders, if they feel threatened by something (be it a ship, a turret, or whatever) they will stop doing what they were told to do and go about dodging and attacking what they feel threatened by.
A further caveat about AI and attack orders... if the object they are told to attack is too far away (seems something in the range of 3500m or so), they will still just sit there doing nothing. So if you are having them attack something farther away than that, you can add a waypoint path point for them to fly to, in order to get them within range of their "attack vision". Just make the "waypoint-paths-once" order the same priority as the attack order so that as soon as they fly within range (or if by chance the object to be attacked is within range do to events unfolding differently than you originally planned), they will commence attacking.
The only down side to having to use the "Disable Self Preservation" option is that you must provide them with orders to get them to do anything the entire mission. After they have performed their basic task(s), you can get them to revert to "Self Preservation Mode" by doing a "clear-goals", following by a "attack any ship".
EE redons his lurker suit