QuoteHighlight&Annotate script

Hi All,

these are two really great and extremely helpful scripts! A very big thank you to the creators! Your efforts are sincerely appreciated!

I was wondering if any of the power-users out there might be able to help me out on a little obstacle. When trying to highlight and annotate a specific .pdf file (that is identified as “PDF + Text” in DTPO’s file kind) with the QuoteHighlight&Annotate script, I get following error message: “DEVONthink Pro got an error: Can’t get every text of think window 1”.

Could anyone maybe be so kind to point me in the right direction how I can identify the reason (and possibly a solution) for that error message?

Thanks & best regards,
Thomas.

Wow. This script is fantastic and is exactly what I need. These user forums are an absolute goldmine of information that I wish I’d found earlier.

Talk about hiding your light under a bushel. The folks at DevonThink need to consider doing a better job of demonstrating how their product can be used. Even if it’s only a “Best User-Designed Scripts” page. Then they can say “we don’t technically support or endorse these scripts, but here are some amazing ways our users are making DevonThink into what they need.”

Hello,

thank you very much all for making this much needed script!

Unfortunately I tried the different versions of it and I receive most of the times an error message. It does highlight the selected text, but do not copy it in the Quotations document. The only times I don’t see an error message, it seems that it is because I applied the script on a document that already had an Annotation document linked to it, so the script doesn’t try to create a new document but uses the existing one instead. This, for example, is the error message when applied on selected text inside a document named testdoc.rtf:

An error occurred when adding the Quotation.
It is impossible to set name of missing value to “testdoc.rtf: Quotations&Annotations”.

Does one of you has an idea of what could be the problem/what I could be doing wrong?

Thank you very much for your help! I recently discovered Devonthink, which is great, but this script is truly something that would make it fantastic…

the same problem here
i think the problem lies in el capitan: the scripts from Frederico won’t work under 10.11

actually I had this problem before updating to el capitan so I think that it’s probably related to something else (and I haven’t tried it since, but I will check if it makes any difference).

@robindx, @hermeneut, and others:

The script is working over here, and debugging shows no errors ( DEVONthink 2.8.6 on 10.10.5). When you say “it” fails please explain what version “it” is. The most recent one that Frederiko posted is here:

and I’m not able to make it fail.

Frederico’s scripts, both with and without Omni Outliner feature, won’t work under 10.11 (El Capitan) if SIP (System Integrity Protection) is enabled.
So, I tried to disable SIP and then the scripts works. But that’s the problem. I don’t understand why SIP blocks Frederico’s scripts!?
Right now, I’m working with disabled SIP, because my works heavily depends on Frederico’s scripts, and I would like to find a solution not to disable SIP.
Anyone knows where the problem lies?

SIP wouldn’t like be affecting Frederiko’s script. The script is not accessing SIP-protected directories, though there’s a possible issue with GUI scripting.

The script might need to be compiled again on your machine. Make a duplicate copy of the .templatescriptd package and reveal the contents of the package (from the Finder contextual menu). Navigate to “~/[script].templatescriptd/Contents/Resources/Scripts/main.scpt” and open “main.scpt” in Script Editor under 10.11. Compile and save. If there’s a compilation error, please reply here.

thankx @korm for your help

i already did that, but no help.

with sip enabled, the script makes the file (with title, date…), but the script won’t copy highlighted text, and I get an error “Can’t get every text of think window 1”

thanks both for your replies. I tried to compiled again the script from my computer, but unfortunately I still get the same error (that I was describing in my previous post). The script does the highlighting correctly, but after it fails to create the new quotation document (and paste the selection in it). Where could this come from?

It will be a couple of days before I get around to installing El Kap and probably a good many more before I can find a solution (if there is one).

I agree with Korm, this sounds like a script permissions issues. Cross application scripting is becoming harder as Apple doubles down on security.

In the interim I would suggest putting the scripts in the /User/[User Name]/Library/Scripts Folder and seeing if they work any better from there. You can access scripts in that folder by:
1: Opening Script Editor
2: Opening Script Editor preference (Cmd , )
3. Select the General Preferences Tab
4: Next to the ‘Script Menu’ Item, tick the box next to ‘Show Script menu in menu bar’

A new applescript menu item will then appear on the right hand side of the menu bar from which you can access system and user applescripts

Frederiko

thanx Frederiko

i tried that

right now, my SIP is disabled, and the script succesfully copied the first highlighted text, but for the second one i get the same error: can’t get every text of think window 1

very strange!!??

@robindx, @hermeneut, and others:

Bad news and good news. The good news is that the Omnioutliner annotation template script (http://viewtopic.php?f=20&t=12038&start=20#p96362) worked straight up after I upgraded to El Kap. No need to disable SIP or do anything else at all. I also haven’t seen the slow response time in inserting text into OmniOutliner that korm has found.

The bad news is that I can offer little help to people who have problems without being able to debug them myself. There is no elegance to the script and it was hacked together until it worked for me. I suspect I got lucky with the random magic of a thousand monkeys typing. With that in mind I have a few things you might try.

  • Have the active window in Omnioutliner and the active window in DT on the same screen and desktop. What DT and OO regards as their frontmost window can get very confused if you try to run the script with DT and OO windows in different desktops and can throw up very similar sorts of errors to those reported.

  • Make sure the pdf document you are annotating from is a pdf from a good source. I have seen instances where DT doesn’t actually report pdfs as pdfs in applescript even though they show as such in the columns. I suspect these come from poor pdf generators.

  • You might try the script from this thread - [url]Cite&Write with OmniOutliner] - Its not exactly the same, but does many of the same things. Because it doesn’t use a template, you can put in the User scripts library as I outline in a post above this. This is a more reliable location for cross application scripts to be run from in my experience.

  • You can try and debug it yourself. Head over to http://www.latenightsw.com and download the trial of Script Debugger. Everyone should experiment with inflicting pain on themselves at some point!

  • Try the original, and still the best, [url]QuoteHighlight&Annotate script]. Gts’ script has stood the test of time.

Frederiko

dear Frederiko,
thank you so much for all your work!
i can confirm that your script with OO works! that’s the good news.

the bad news is that your second script does not work. i suppose that i am not the only one whos academic work heavily depends on your second script (the one without OO). i can not imagine my daily workflow on writing academic papers and books without your second script.

i would like kindly to ask you: can you please take a look and make your second script available under el capitan?

thanx
rastko

v. 2.8.7 under el capitan

the script works unfortunately with every second highlight, i. e. it crashes on every second highlight.

this is a big problem for everyone that uses this wonderful scripts

well, at the end i think that we are hopeless without Frederiko’s help.

in last OS 10.11.1 only script with Omni Outliner works, but with heavily crashes. other Frederiko’s scripts won’t work even if SIP is disabled.

how it can be that Annotation script that comes with DTPO 2.8.7 works flawlessly, but Frederiko’s script not at all?
does someone has explanation for that?

Frederiko’s scripts are essential for every academic work, so please help!!!

EDIT: the problem is with german letters ü, ä, ö. if i try to annotate the sentence with this letter, the script crashes. but with english text everything is fine.
any solution for that?

a nice guy helped me.
the devs here are very lazy. if i paid so much for this app, i would like at least a try and good will to help the customers. so solution is:

Find the 1st two lines below and then add the next two lines immediately after:

– get the current text selection:
set theQuotationText to selected text of theFrontmostWindow

 -- Need to convert character sets in order to get the umlauts to transfer correctly.
 set theQuotationText to (do shell script "/usr/bin/iconv -f ISO8859-1 -t MACINTOSH " & theQuotationText)

Please hold it right there, Hermeneut! If you follow the discussions in this forum, you should know that the devs are not lazy, and indeed very helpful. Getting nasty every time when you don’t get what you want is very poor style.

But it gets worse: we are talking about a customer-provided script here. There cannot be a firm expectation that the devs will respond to each and every coding problem. They often will, but in the end, customer scripts are the responsibility of … customers.

And you paid “so much” for this app… If you had to make a living selling this product, for how much would you give it away? Just wondering. And would you stay up another 3 hours each night to fix customer scripts?

You’re very generous, @gg378.

As is @Frederiko who undoubtedly has spend many hundreds of hours or more contributing finely wrought and highly useful scripts for no reason other than he enjoys doing it and intends to share with others.

For free.

If that is “laziness”, then I want to be as lazy as Frederiko.

@hermerneut you are not only way out of order but plainly wrong. It is guys like @Frederiko, @korm, @gg378 and others who unselfishly and generously write, maintain and give advice to the less competent and incompetent, (the latter of which I include myself as far as scripting is concerned); I have benefited enormously from these guys skill and labour and am always grateful when their help is forthcoming. As for the developers I do not know of any other software company that is as good and diligent at responding to user’s problems as they are.