Works in Script Editor but not in Script Debugger

Why does this work in Script Editor but not in Script Debugger:

use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
use framework "AddressBook"

-- classes, constants, and enums used
property NSPNGFileType : a reference to 4
property ABAddressBook : a reference to current application's ABAddressBook

set imgData to ABAddressBook's sharedAddressBook()'s |me|'s imageData()

Script Editor accepts |me|'s, Script Debugger does not.

Can someone please help this beginner.

I’m not sure – it works for me here. What version of the OS are you running?

Generally, though, it’s more reliable to use accessor methods with properties. So try this:

set imgData to ABAddressBook's sharedAddressBook()'s |me|()'s imageData()

This doesn’t work - “missing value”

use AppleScript version “2.4” – Yosemite (10.10) or later
use scripting additions
use framework "Foundation"
use framework “AddressBook”

– classes, constants, and enums used

set imgData to current application’s ABAddressBook’s sharedAddressBook()'s |me|()'s imageData()

Sorry you asked about os version:

10.12

FWIW, it’s works here, on 10.12.

Have you checked if “My Card” (that is, me) is set in Contacts?

Only when I remove “My Card” I get:

missing value doesn’t understand the “imageData” message.

OK, thanks for everyone’s help. I have managed to fix this.

I had to go to System Preferences/Security & Privacy/Privacy and allow Script Debugger access to my Contacts.