Script: sync Zotero to DTPro

I can’t think of anythning in the script which would delete a group. Are you able to debug the script (using Script Debugger) and hence to check what line of code might be causing the disappearance?

Well now I edited the template file slightly to add some carriage returns at the end and it is not creating any items other than the initial “dictionary_zoteroid_uuid” file - even if I revert to the prior template, same thing.

Well thanks for the help - will be interesting to see if others can get it working - so close…

Ahah… almost solved

Found them!

The new items are initially appearing in /Library in my Zotero-DT3 database, then they are being moved instead to the inbox of a totally different database and replicated to a Group in that same database where I had been working.

So it is working (very nice!) but not putting items where I expected. How do I define where the items should go - and why would they be replicated in any event?

No idea! For me, those variables control the destination. I think this is where some DT help might be needed - the script works fine for me…

It seems to me that the script has some error checking and defaults to previously used locations (potentially unrelated to the script entirely) under some circumstances. I need to study that a bit more to understand the logic.

This is interesting and perhaps related to why the correct database is not being opened - for some reason the script will not compile now with Script Debugger:

Question - Can anyone else on the Forum compile the original script in the beginning of this thread?

I am puzzled because I was able to do so initially but now I keep getting the “Expected end of line but found identifier” error. Why would it have compiled originally but now will not do so?

It compiles in Script Editor without incident here.

Very interesting - it worked for me a couple days ago but now the exact script from above will not compile. No changes to my computer that I can recall that would be relevant. Any idea why it would sometimes compile and sometimes not?

Look for an errant quote mark.

Thank you

Fixed

I had several of the “Substitutions” selected in Script Editor - that must have altered the quotes somehow.

I figured it was something like that.

OK I am really sorry to keep posting about this same script - your patience is much appreciated.

Today with all the substitutions turned off as previously it again will not compile when I copy/paste the original script. I cannot identify anything different from when it did compile yesterday. What might I be doing or overlooking which is making this sometimes work and sometimes not work? Other scripts compile fine - there is something about this one that I am overlooking or not realizing that results in the same error above intermittently when I try to compile it.

Just checking: have you tried Script Editor instead of Debugger? I don’t know that it would make a difference, but who knows…

Yes - Script Editor and Script Debugger both give a similar error message. I did get it to compile a few times using Script Editor and thereafter the compiled script would run on Script Debugger, but I was never able to compile it successfullly on Script Debugger

Does it compile for you on either one or both? If yes, what settings on my computer might cause this?

I’m just wild guessing here but could it be that Script Debugger somehow tries to compile the script for DT 2?

I get a similar error when trying to compile the script with DT 2, which obviously doesn’t work since the script is written for DT 3.

How do you compile a script “with” or “for” DT 2? The Tell statements reference DNtp which is correct.

So if you try to compile it wit Script Editor you get a similar error? That would appear to replicate/confirm my problem. The question remains - why does it happen, and why does it sometimes compile and sometimes not compile?

AFAIK, tell application id "DNtp" did already work with DT 2 and I remember having used this tell statement with DTP2. See:

Trying to compile the script with Script Editor and DT 2 gives me this error:

@rkaplan do you get the correct reference to DT3 when executing this one line:

tell application "Finder" to get application id "DNtp"

Your error translates per Google translate to “Line end, etc. expected, but property found” which is essentially the same error I got.

Seems to me you are compiling it with Script Editor with the comment that it is for Applescript 2.4. Whether the compiled script runs on DT2 or DT3 is a separate issue.

So you are getting the same error as I am - why?