Dynamically get Object property from user input

Aarcanist8/17/2021
Anyone know how I can do this?

I have an Actor (myactor) and I'd like to have an input box which the user can use to refer to any of its properties, by typing in a path (i.e. @data.abilities.str.proficiency).

How can I get that property within my script after they type in the box?

I'm thinking that I could use Autocomplete Inline Properties, but don't know if that does this.
Aarcanist8/17/2021
🧵
Aarcanist8/17/2021
myActor + "['data']" doesn't return myactor['data']. Instead, it returns "myactor['data']"
CCalego8/17/2021
Where is your input being created? a Dialog?
Aarcanist8/17/2021
A form application
Aarcanist8/17/2021
I think that's the solution, thanks!
LTLLLeo The League Lion8/17/2021
@arcanist gave :vote: LeaguePoints™ to @Calego (ElfFriend) (#1 • 1086)
CCalego8/17/2021
The input's value should be available as part of the _updateObject's parameters. One of those is all of the data of all of the nameed inputs in the <form> element of the formAppliation
Aarcanist8/17/2021
I'm going to take a look at how that works in case I ever want to do this outside of Foundry
CCalego8/17/2021
Here's similar from lodash: https://lodash.com/docs/4.17.15#get
CCalego8/17/2021
Must easier to read than lodash source:
https://youmightnotneed.com/lodash/#get
CCalego8/17/2021
(welcome to recursion. please make yourself welcome to recursion. please make yourself welcome to recursi.....)
Aarcanist8/17/2021
Ah, nice trick with Array reduce