QuoteHighlight&Annotate script

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.

^^ This! Couldn’t have said it better.

sorry, i made a mistake writing that words.
but please understand me: i don’t have any knowledge in scripting or programing; i’am just an academic whos work heavily depends on Frederiko’s OO script. I was trying to find an solution for weeks.
i think the solution can be very quicky generated if one, who knows scripting, take a look at Frederiko’s OO script.

The solution that i gave here in my last post:


set theQuotationText to (do shell script "/usr/bin/iconv -f ISO8859-1 -t MACINTOSH " & theQuotationText)

didn’t solve the problem.

So, once again, Frederiko’s OO script works very well with english letters, but with german umlauts (ü, ä, ö) gives errors.

Some other good soul offered me this solution:


set theQuotationText to (do shell script "/bin/echo \"" & theQuotationText & "\" | /usr/bin/iconv -t MACINTOSH")

but it also gives error:

i think this “1:11” or “1:38” are numbers of selected words

Can anyone please take a look and eventually find a solution for this problem? For this problem didn`t exist in Yosemite. It appears only in El Capitan

but maybe the problem lies somewhere else !!!

the original script gives me errors, but it copies the selected sentences with umlauts. see:

there are errors, cause the script didnt make link to annotated page the first and third quotation are good, but the second with umlauts dont have valid links.
and this is the error for second quotation:

Hi,

I have found this thread extremely helpful. I have one problem/question — with the caveat that I am not someone who has does very much tinkering with scripts, etc.

Whenever I make an annotation to a pdf on the basis of a highlighted section using the QuoteHighlight&Annotate template, the new annotation RTF shows up in my global inbox, rather than the local database inbox or the folder where the pdf I have been editing is located. Is there any (reasonably feasible for an amateur) way to change this?

Many many thanks,
Joel

@lande80 what version of the script are you using – there are several versions in this thread.

Also: one additional question: what does it mean when I get this error? Is there anything I can do to fix it?

I am using this one
_QuoteHighlight&Annotate___Cmd-Alt-Q 2.templatescriptd.zip (28.3 KB)