Getting the id of the current item / weapon / armor selected in the menu

Is there a better way of taking the id of the item, armor or weapon currently being selected by your cursor when you open up your menu?

ljLR3GK.jpg


If I select down Item for example and my cursor is on Potion, how can I get the potion's id, since its the one my cursor is selecting at?
It depends on what menu you have open, is it the item menu? the Shop Menu? If it is the party item menu then it will be something like this:

Scene_Item.prototype.item();

If you use it in the Scene code itself then it needs to be:    this.item();

All this is traced back to the original : Window_ItemList.prototype.item()

Original thread: https://forums.rpgmakerweb.com/threads/getting-the-id-of-the-current-item-weapon-armor-selected-in-the-menu.52881/