assign [class="Smplayer"] $workspace4
assign [class="Code"] $workspace2
assign [class="Cherrytree"] $workspace3
To get the class and instance, you can use xprop. After clicking on the window, you will see the following output:
xprop:
WM_CLASS(STRING) = "irssi", "URxvt"
The first part of the WM_CLASS is the instance ("irssi" in this example), the second part is the class ("URxvt" in this example).