Reddit - Unread mail count

I've made a widget for unread reddit messages.
Set the predefined action to open URL:
and on long press to open URL: if you want an option to go to your front page too

-- You need to go to while signed in, copy the link from the JSON button next to Unread Messages and paste it into the script below.

set jsonurl to "YOUR URL"
tell application "JSON Helper"
    set UnreadFull to fetch JSON from jsonurl
    set unreadcount to dist of |data| of UnreadFull
end tell

if unreadcount is 0 then
    set unreadcount to " "
end if
return unreadcount

It doesn't work for me. When I try to compile the script, BTT gives me an error in JSON in the line
set UnreadFull to fetch JSON from jsonurl
The error given is: "Expected end of line but found identifier."

Note to everyone here

To get this to work you will need to install JSON helper.

Note to @Doa:
You might want to put that in your post!

1 Like

Thank you. Would it be possible to do the same with the notifications of this forum?