Random 'missing value' result on 'create PDF document from'

Hi,

I have a script that archives a GIThub project page hierarchy into a single PDF document. Till recently, it worked very well, but now a get a random problem that I cannot explain. This complete script fyi can be found here.

During the loop, I call the “create PDF document from” function of DT like shown below.



set contentobject to create PDF document from newwebsiteurl name newwebsiteurl

if contentobject is missing value then
  log "DT create PDF document returns 'missing value'"
  log "    from: " & newwebsiteurl & ", name: " & newwebsiteurl
  log "    return: " & contentobject
end if

Since recently, the “create PDF document from” randomly returns “missing value”. It’s about 1 out of 10 URLs. No PDF is created in this case. (I need the contentobject to later merge all single PDFs into one).

For each run, even on the same repository, it’s a different sub-set of pages that produces the missing value. It really looks random.

When I open the URL in question in the browser, it shows the page. The URL is valid.

I don’t know exactly as of which DT moment/version this occurs. The DT log file that I can access via the DT menu does not show any message.

Has someone an idea?

Might there be a regression in a newer DT version?

Is there a way to get more information about what triggers the issue (eg other low-level logfiles)?

Thank you very much!
I.

This might be a timeout, e.g. due to a not responding server or concurrent network traffic. Does a restart fix this?

Hi,

I restarted the mac, gave him a minute to get it all together, started only firefox and script editor and did multiple tests.

Unfortunately, the error still is the same.

Is there a log file that I could check for more info?

Thank you!

You could have a look at the file ~/Library/Application Support/DEVONthink Pro 2/Console.log or send it to cgrunenberg - at - devon-technologies.com.

On its way. Thank you!

After an amazing interactive support from cgrunenberg, thanks :slight_smile:, we figured that it’s indeed a kind of time out.

The solution was very simple - just add a 2/3rd attempt:


repeat with i from 1 to 3
   set contentobject to create PDF document from myurl name myname
   if contentobject is not missing value then exit repeat
end repeat
if contentobject is missing value then
   -- run in circles and shout...
end if