A little late to the convo, but I'm posting for anyone who finds this post later and needs the solution:
You can use the /stopmacro command to achieve this all in 1 macro. For instance, on Wrath classic, my TMW profile swap macro looks like this:
/tmw profile Arms
/tmw profile Prot
Arms is my spec 1 (primary) and Prot is my spec 2 (secondary).
If I'm in primary spec (1), this macro runs the Arms profile and then runs stopmacro.
If I'm in secondary spec (2), this macro runs the Arms profile, sees I'm not in spec 1, so it continues to then run the Prot profile.
On retail, the spec modifier corresponds to 1,2,3, and 4. Most classes have 3 but it of course differs for Demon Hunters (1-2) and Druid (1-4). You'll need to slightly adjust the macro if you want it to work for 3 or more specs, of course.
/tmw profile name1
/tmw profile name2
/tmw profile name3
Something like this might work.
I do it this way because I have not been able to find a way to make the spec modifier work on the same line as the /tmw profile command.