You can clear duplicate lines in the Mac context menu with the following command in Terminal:
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister —kill -r -domain local -domain user
And restart Finder with the command:
killall Finder
The context menu will be cleared.