This AppleScript will export each contact to its own vCard in the folder ~/Action/vCards/ :
set vPath to (path to the home folder as string) & "Action:vCards"
alias vPath
tell application "Contacts"
repeat with cardPerson in people
set nameOfvCard to name of cardPerson & ".vcf"
set outFile to (open for access file (vPath & ":" & nameOfvCard) with write permission)
write (vcard of cardPerson as text) to outFile
close access outFile
end repeat
quit
end tell
But when I tried to run it in Keyboard Maestro, I get the following error:
2021-11-18 04:02:25 Action 12588 failed: Execute an AppleScript failed with script error: text-script:109:364: execution error: Not authorized to send Apple events to Contacts. (-1743)
2021-11-18 04:02:25 Execute an AppleScript failed with script error: text-script:109:364: execution error: Not authorized to send Apple events to Contacts. (-1743). Macro “Export vCards @daily” cancelled (while executing Execute AppleScript).
There does not seem to be a way to add Keyboard Maestro to the "Contacts" section of System Preferences, as shown here:
You (probably?) need to enable Automation control of Contacts by Keyboard Maestro Engine.
Any script you run in Keyboard Maestro that communicates via AppleScript with another application will require Keyboard Maestro Engine to have Automation permission to control that application.
When I was fooling with Big Sur on your mini, I was having terrible problems with permissions dialogs flashing by and not giving me the chance to interact with them.
This is Monterey on the Mini, but it's been completely wiped and a clean install done since then.
Also I'm pretty sure those issues were due, at least in part, to both of us being logged in at the same time, which I think macOS "supports" but does not get a lot of Q&A done on it!