As mentioned in our ようとする
lesson, when combined with the 助動詞（じょどうし） (auxiliary verb) う (or よう), とする carries the meaning of ‘to try to do (A)’, or ‘to be about to do (A)’. The 格助詞（かくじょし） (case marking particle) と in this expression highlights a ‘result’.
However, the addition of structures like the 接続助詞（せつぞくじょし） (conjunction particles) が, or たら
, to the past tense of する
will indicate that something interrupted (A), and therefore it was unable to be completed. In these cases, the translation becomes ‘to have tried to do (A), but (B)’, ‘was about to (A), but (B), or ‘was on the verge of (A), but (B)’.
I tried to make a phone call to our client, but it was late at night so I decided to wait until morning.
I was stopped by the police when I was about to swim in the lake.
I was about to run away, but if I got caught, it would have become a bigger deal, so I didn't.
う and よう mark volition (the express intent to do something), while とする adds the nuance that the express intent has been decided, and all that remains is to ‘do’ the action. Due to this, when something interrupts a ようとする
verb, it strongly suggests that (B) is/was highly unanticipated.