So I have a system where the player creates a 'token' misc object in the cooking menu, and the token runs a script as soon as it enters the player's inventory to add a variety of objects and remove itself (crafting recipes that refund non-consumable components or convert one ingredient in the inventory into another). The scripts run fine but after testing, I realized that the crafting menu seems to 'lock in' the player's inventory when the menu opens, and it can't see anything added to the player's stuff that the menu itself didn't put there. To get expected behavior out of the system, the player has to close the crafting menu then reopen it after every recipe crafted.
Is there a way to update a workbench's picture of the player's inventory via script? Perhaps in F4SE? Maybe editing the SWF file's actionscript?
Is there some obscure way to close and reopen a menu automatically? Or are all updates to the workbench menu hard-coded?