You cannot macro these actions, but the game does remember which slot you last gathered from, so you can just keep hitting NumPad0 (or whatever your confirm button is) and automatically strike the last spot you selected.