There is no API way of getting the item id directly from an item unless it is dragged to a quickslot -or- linked to chat from a vendor.
However, on lorebook they show ~340 potions total. A person could make a name to id mapping and keep that in one of their plugin files. That way when you scan through your bag, if any match one of those 340, then you have the id to convert to hex and thus make quickslot.
If you download LOTRO Compendium addon (shamless plug), you can grep through the item database for rows that have a category of potion and get all the ids :
Code:
$ grep '"Potion"' Items/CompendiumItemsDB.lua | more
{rl=1,l=15,n="+1 Hope Token (15 min)",c={"Potion"},q="Rare",id="70027FE6"},
{rl=25,l=25,n="+2 Hope Token (15 min)",c={"Potion"},q="Rare",id="70027FE3"},
{rl=30,l=30,n="+3 Hope Token (15 min)",c={"Potion"},q="Rare",id="70027FE5"},
{rl=35,l=35,n="+4 Hope Token (15 min)",c={"Potion"},q="Rare",id="70027FE7"},
{rl=40,l=40,n="+5 Hope Token (15 min)",c={"Potion"},q="Rare",id="70027FE8"},
{rl=51,l=51,n="+5 Hope Token (30 min)",c={"Potion"},q="Rare",id="70027FE4"},
{rl=35,l=35,c={"Potion","Champion","Craftable"},n="Artisan Potion of Fervour",cl="Champion",q="Uncommon",id="70024348",lb="Artisan Potion of Fervour Recipe"},
{rl=35,l=35,c={"Potion","Hunter","Craftable"},n="Artisan Potion of Focus",cl="Hunter",q="Uncommon",id="70024345",lb="Artisan Potion of Focus Recipe"},
{rl=51,l=66,n="Asteric Edhelharn Token",c={"Potion","Craftable"},q="Incomparable",id="70028075",lb="Vitreous Edhelharn Token Recipe"},
{rl=1,l=1,c={"Potion"},ib="BoA",n="Battle Potion of Defilement",q="Common",id="70028F9A"},
{rl=1,l=1,c={"Potion","Quest Reward"},ib="BoA",n="Battle Potion of Restoration",q="Common",id="70026944",qu="Vol. III, Book 4, No Mercy for Traitors"},
{rl=1,l=1,c={"Potion"},ib="BoA",n="BOO!",q="Common",id="70022C5A"},
{rl=75,l=75,n="Bottled Orc Scream",c={"Potion"},q="Common",id="7001985B"},
{rl=75,l=75,n="Bottled Spider Chitter",c={"Potion"},q="Common",id="7001985E"},
{rl=75,l=75,n="Bottled Uruk Effluvium",c={"Potion"},q="Common",id="7001985C"},