Caffeinate Screen Sharing Macro (v9.2) "... it uses pgrep to automatically get the PID..."
pgrep
PID
For more information, see the wiki Searching the Forum for Answers section.