Select automatically a tagged file in a folder

Hi there,

I would love some help with my Applescript included in an automator workflow.

After choosing a folder in a prompt, I would like the script to automatically look for the only color tagged folder in the chosen folder and copy the name and create a variable in automator.

Is that possible to do with applescript?

Thanks