Using Hyprctl in Terminal

I’m trying to automate switching between workspaces using hyperctl, and have just been testing out the commands in the terminal to make sure they work. However, I keep getting this error about syntax (see the blockquote below for my terminal outputs) and I’m not sure of a way around it. Does anyone here know the correct syntax?

[alcme@stupid-twinkpad~]$ hyprctl dispatch focus{workspace=3}
error: [string “return hl.dispatch(focus{workspace=3})”]:1: attempt to call a nil value (global ‘focus’)

-> Note: dispatch in lua is a shorthand for hl.dispatch(…), your syntax might need to be updated.
[alcme@stupid-twinkpad~]$ hyprctl dispatch workspace 3
error: [string “return hl.dispatch(workspace 3)”]:1: ‘)’ expected near ‘3’

-> Note: dispatch in lua is a shorthand for hl.dispatch(…), your syntax might need to be updated.

(I’ve tried other variations than the ones shown, none have worked :c)

should add that im on hyprland 0.55.2

hyprctl eval ‘hl.dispatch(hl.dsp.focus({ workspace = “+1” }))’

That will move to the next workspace (use “-1” for previous)

You may change “+1” with any workspace number i.e. “3” or “7” etc.