How can I automatically assign Resources with certain UFC to certain Tasks having a a specific Appea


You will have to do this in 2 steps:
First, use the following script to assign the Resources to the Tasks -
TASK( NAME >= "test" ) ASSIGN_OBJECT( VAR RESOURCE( UFV ("Test") >= "Attach" ) )

Then use the following script to udpate the Appearance Profile -
TASK(NAME >= "test").ASSIGNMENT(RESOURCE.UFV ("Test") >= "Attach") SET_PROPERTY (PROPERTY ("Appearance Profile"), ALL_USE_PROFILE (NAME == "Install"))

Do note that instead of using Script to assign Resource to Task, its more efficient to use AutoMatching feature.