I won't do the whole short/medium/long answer thing from your other thread I've just replied to but in early iterations of my characters attack macros I did have branching macros using complex queries which allowed for melee v ranged options as well as ammunition selection etc etc. They were a beast to write, there are likely examples floating around the forums still, BUT once licked they weren't too hard to maintain/build on. The main issue is that everyone uses the 3.5e sheet differently (for example I put att/dam modifiers in the token bubbles for easy dynamic changes from spells, buffs, debuffs etc that only affected individual tokens rather than entire sheets... handy for those mob debuffs). I'd be happy to show a basic example at some point in the future (I'm on leave for the next couple of days and don't have any meetings in which I could dedicate some time to this instead ;) )... but for weapon selection I'd encourage you to look into chat menus, it's so much easier. However, if you are wanting to toggle between melee and ranged for a single weapon (dagger, hand axe etc) then that is absolutely doable with little effort and a single query... again, happy to show an example once I have time.