How can I script a macro to my Mage do several sequencial attacks? I've tried the command /castsequence but it doesn't works.
You can't script several actions to occur automatically on a single mouse click or key press.
The closest you can do is a
WoW's macro system is deliberately unable to cast multiple spells with a single keypress except in very specific circumstances; this is to discourage botting/cheating. Blizzard's approach to macros (in-game or out) is that one keypress should trigger only one action.
The only case in which multiple spells/items can be used in a single macro is when only the last one triggers the global cooldown. This means that a warlock could macro Soulburn and Summon Felhunter together (because Soulburn doesn't trigger the GCD), but not Bane of Agony and Corruption. If you have many spells or items which don't trigger the GCD, you can even chain them together, as in the (in)famous PoM/Pyro macro for mages.
If you want to cast multiple GCD-causing spells with the same macro, you can use