Thank you, @Stephen Marsh. Now it worked as you guided. Initially, I was creating an action, but just like normal actions, I used the shortcut keys to lock the guides. However, it wasn't working because the action wasn't recording. This time, I chose to select 'Insert Menu Items' as you guided, and that worked.
By @ImranWagan
You're welcome, yes, I originally wrote in that topic: Create an Action, insert the menu command for "Lock Guides"... The screenshots in this post probably helped if English isn't your native language.
... View more