Way to move contents of folder, ignoring locked files?

I searched and didn’t find specifically what I was looking for.

What I am attempting to do is clean Folder A on login. What the script currently does is move files to Folder B, overwriting duplicates but it errors on locked files. These locked files I would like to remain in Folder A.

I have found that I can unlock those files, allow them to be moved to Folder B, copy them back to Folder A and re-lock them but that seems less efficient than I imagine it could be. Is there a simple way to ignore locked files when doing the initial move?

Thanks.

Hi,

yes it is:

tell application "Finder" to move (get items of folder A whose locked is false) to folder B  with replacing

Brilliant!
I knew I was missing the simplicity of it all.

Thank you.