Script to look up PDF document metadata on crossref.org

When I compile and run this in DT no results are returned. When I run in the Script Editor, I get: curl: (6) Could not resolve host: api.crossref.org.

Yet I can visit api.crossref.org and even: https://api.crossref.org/works which returns a JSON (??) result.

What have I done wrong?
- Mark

Just add to the confusion. I rebooted my computer, the script now runs from the ScriptEditor but not from DT.

The first problem looks like a problem with DNS – possibly something transient on your computer.

Running from scripteditor but not DT usually happens to me when the script isn’t actually compiled. Follow the instructions carefully is the best advice I can give.

I did follow the instructions. The script is compiled. A screenshot is attached to show this is true:

Just a minute ago I tried to run it from DT - no result. I ran it from the Scripts Editor and it works.

Anything in DT’s logs?

Funny thing, I had to reboot my MBP for other reasons. I tried rerunning the Script inside DT so I could share logs and viola a JSON permissions dialog appeared. I hate computers. I hate computers.

Thanks to all for helping me.

I feel your pain more often than not :slight_smile:

2 Likes

I had the exact same issue, as described in the post above

In my case, accepting this permissions dialogue along with setting the correct Exiftool path solved the issue. Did you check if Exiftool is indeed installed in the path that is set in the script?

Thanks. My late father, who was professor of Computing Science, said that allowing computers into the wild was a mistake. That they should have been left in the hands of computer scientists. He also commented that computers had just allowed humans to screw things up faster. (Paraphrase on my part).

@AW2307 Thanks I wasn’t clear enough. As soon as I granted the permission the Script worked. Why I didn’t see the perm dialog the first dozen times, who knows.

1 Like

I can’t disagree when looking at the world & the news.

Not to launch a massive off-topic conversation, but I need the chief developer of one of my favorite applications to have an optimistic outlook :wink:

It’s easy to miss the forest for the trees, i.e. to mistakenly take current events as an accurate reflection of long-term trends. Most objective indicators actually show that the world is getting better by and large. Interestingly, there is (and has been for decades) a large disparity between public perceptions and what the actual data bears out.

Books on this topic: Factfulness (Hans Rosling), Enlightenment Now (Steven Pinker) or The Rational Optimist (Matt Ridley).

1 Like

FYI, I’ve just updated to get a more accurate publication date from crossref.

1 Like