Having no luck scripting the Contacts app

Hi everyone,

It’s been a while since I did any scripting and I am just perplexed by getting error -1743 for everything I try to put inside a tell block to Contacts.

tell application "Contacts"
	activate
	set myCard to my card
end tell

=> error -1743
offending object: my card


tell application "Contacts"
	activate
	get name of every person
end tell

=> error -1743
offending object: every person

And so forth. Using Script Debugger 6.0.1 .

It must be something trivial. What am I doing wrong?

Which operating system are you running ?

Here - Sierra 10.12.3 - your two scripts behave flawlessly.

If my memory is right, under Mavericks, we had to open Contacts by hand before being able to drive it with a script.

Yvan KOENIG running Sierra 10.12.3 in French (VALLAURIS, France) mercredi 22 mars 2017 20:27:05

Thank you for replying.

I’m running Sierra 10.12.3 as well.

Contacts is open. The “activate” switches to Contacts for a half second, then Script Debugger pops back up with the error. I get the same error no matter what message I send to the Contacts app.

AHA! I works in Script Editor. Must be a setting or a bug in Script Debugger.

Any Script Debugger fans here?

It’s working fine here in Script Debugger 6.0.4. Is there some reason you are still using 6.0.1?

Ah, sorry. I checked and it is indeed 6.0.4.

I can’t find error -1743 anywhere in Google.

I’ll poke around a bit more and ask at Late Night if I can’t figure it out.

Thanks for the help.

It sounds like a permissions problem. Go to System Preferences, Security & Privacy → Privacy, click on Contacts, and see if Script Debugger has access to your Contacts.

You’re right - that was it. Works fine now.

Thanks to all.