Count files in OneDrive

how do I count files in my OneDrive

–not working

tell application "Finder"
	set volumeName to "OneDrive" -- CHANGE THIS to your volume's name
	set volumePath to "/Volumes/" & volumeName
	set x to count every file of disk volumeName
end tell

Check your actual OneDrive path.

For example, here it’s:

~/Library/CloudStorage/OneDrive-%user name%