well your macro works for me when I replace the ` by '. But it could still be some issue with the quotes. You could try double quotes instead:
for peak in current.peaks:
print(f"Pid: {peak.pid}, S/N: {peak.signalToNoiseRatio}")
Note that if your quotes are being recognised correctly, the colouring of the code in the Analysis Console should look like that below. In your (original) screenshot the whole of the section inside the print ()s is black and not colour coded.