You can decant noted pots, but they have to be done by the NPC.
OnTopic:
You use a different mousebox for each inventory spot. You could try something line this:
Simba Code:
procedure CleanHerbs;
var
i,prevXP,time:integer;
begin
for i := 1 to 28 do//Goes through each spot in the inventory
begin
prevXP := GetXpBarTotal;//Gets XP before you cleaned
MarkTime(Time);//Marks time for your time out failsafe
MouseTBox(InvBox(i),1)//Clicks in the inventory box.
While(PrevXP = GetXPBarTotal) do//While you XP from above is the same as your XP bar, do this
begin
if(TimeFromMark(Time) > 15000) then//If Time is greater than 105seconds
break;//Break from the While loop
Wait(100);//Else, it waits, 100 milliseconds before checking for an XP change
end;
end;