How to refer to «enum ecvwgrvw» in a script?

Hi,

I’m trying to set a Finder Window’s current view to group view.

When I use group view, Script Editor curiously changes it to flow view when I compile the script. Digging into the the scripting dictionary reveals that both flow view and group view share the same enum code:

		<enumeration name="ecvw" code="ecvw">
			<enumerator name="icon view" code="icnv"/>
			<enumerator name="list view" code="lsvw"/>
			<enumerator name="column view" code="clvw"/>
			<enumerator name="group view" code="flvw"/>
			<enumerator name="flow view" code="flvw"/>
		</enumeration>

Looking back at my meticulous notes *cough*, I noticed that sometime in the past the correct code for group view is actually grvw.

So the question is how do I use this code instead of the term group view? I was hoping the following code would work, however it errors out at «enum ecvwgrvw» with ‘Expected expression but found “«”.

set the current view of the window of folder "Applications" 
    of disk "macOS" to «enum ecvwgrvw»

Is it even possible to do what I’m trying to do, and if so, how?

Thanks for your help. It’s made me realise why Apple have set the scripting dictionary codes to match each other for group view and flow view, and helped me understand that group view is obsolete. Instead, much like sorting, grouping can be applied to the other views.

And as you said, it looks like the only way to apply grouping is via key strokes. :+1:t2: