Create one file for handling storage and executing a command
Is there any way to not do this across 3 files but instead just 1
test
data modify storage minecraft:helditem itemname set from entity @s SelectedItem.components."minecraft:custom_name" function emeraldequip:test2 with storage helditemtest2
$data modify storage minecraft:helditem itemname set value $(itemname) function emeraldequip:test3 with storage minecraft:helditemtest3
$say $(itemname)