Re: [Bibdesk-users] Escaped characters in filename using autofile

2010-04-15 Thread Peter Cowan
On Wed, Apr 14, 2010 at 3:09 PM, Christiaan Hofman cmhof...@gmail.com wrote:

 On Apr 14, 2010, at 23:40, Peter Cowan wrote:

 On Tue, Apr 13, 2010 at 2:22 AM, Christiaan Hofman cmhof...@gmail.com 
 wrote:

 On Apr 13, 2010, at 11:06, Christiaan Hofman wrote:


 On Apr 13, 2010, at 2:45, Peter Cowan wrote:

 All,

 Two of my favorite issues in BibDesk are the autofile feature and the
 Send via Email features.  Recently I ran into an issue where when
 certain citations were selected the Send via Email silently failed.
 This turned out to be because the associated pdf filename was

 Sax D  Gaines S 2003 Trends In Ecology \ Evolution.pdf

 Getting rid of the slash before  fixed the issue.

 My autofile format string is: %A[  ][ ]3 %Y%u0 %f{Journal}30%e

 and I have selected Clean by removing Tex.  This produces the above
 file for the citation:

 Sax DF, Gaines SD (2003) Species diversity: from global decreases to
 local increases. Trends In Ecology  Evolution 18, 561–566.

 To summarize, some of my journal names have  in them which is
 escaped as \, which is subsequently in the filename when using
 autofile.  These files then cause Send via Email to fail.

 What am I doing wrong? Is there a work around?

 Thanks

 Peter


 Unfortunately, I think you're doing nothing wrong and there's no 
 workaround.

 Christiaan

 I've fixed this for tomorrow's nightly, please test it out.

 Christiaan,

 Thanks for such a quick response.  I tried the nightly marked
 BibDesk-20100413.dmg (is there a way to tell which SVN revision that
 is?).  And, I also checked out the source and attempted to build it
 myself (which seemed successful with the debug type selected).

 Unfortunately, both versions also fail silently, with the file: Sax D
  Gaines S 2003 Trends In Ecology \ Evolution.pdf.   I get the
 following message in the console:

 4/14/10 2:34:25 PM    BibDesk[11223]  Error compiling mail to script: {
    NSAppleScriptErrorBriefMessage = Expected \U201c\\U201d but
 found unknown token.;
    NSAppleScriptErrorMessage = Expected \U201c\\U201d but found
 unknown token.;
    NSAppleScriptErrorNumber = -2741;
    NSAppleScriptErrorRange = NSRange: {463, 1};
 }

 Did the nightly I grabbed not have the relevant update?   I appreciate
 you attention, to this minor issue!

 Peter



 Christiaan

 It seems I escaped one type of ampersand but not the other. Please try 
 tomorrow's nightly (dated for today).

I'm still getting the same error as above.   I tried to look at the
code and see if I could fix it myself (it is open source after all),
but my objective C is too weak.

I do notice that the changes you made over the last couple of days
escape the body of the email message.  To my untrained eyes it seems
that the problem is with the file name.  For example, my autofile
format yields the following filename.

Sax D  Gaines S 2003 Trends In Ecology \ Evolution.pdf

This give the above error in the console and mail doesn't open.  If I
go and manually change the name of the linked file to

Sax D  Gaines S 2003 Trends In Ecology Evolution.pdf

Send via Email works perfectly.  I tried to look at how the array of
files is constructed, but it was beyond me.

Sorry to take up your time with this minor issue.  I do appreciate
your efforts to help.

Peter

 Christiaan


 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Bibdesk-users mailing list
 Bibdesk-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/bibdesk-users


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Bibdesk-users mailing list
Bibdesk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


[Bibdesk-users] Escaped characters in filename using autofile

2010-04-12 Thread Peter Cowan
All,

Two of my favorite issues in BibDesk are the autofile feature and the
Send via Email features.  Recently I ran into an issue where when
certain citations were selected the Send via Email silently failed.
This turned out to be because the associated pdf filename was

Sax D  Gaines S 2003 Trends In Ecology \ Evolution.pdf

Getting rid of the slash before  fixed the issue.

My autofile format string is: %A[  ][ ]3 %Y%u0 %f{Journal}30%e

and I have selected Clean by removing Tex.  This produces the above
file for the citation:

Sax DF, Gaines SD (2003) Species diversity: from global decreases to
local increases. Trends In Ecology  Evolution 18, 561–566.

To summarize, some of my journal names have  in them which is
escaped as \, which is subsequently in the filename when using
autofile.  These files then cause Send via Email to fail.

What am I doing wrong? Is there a work around?

Thanks

Peter

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Bibdesk-users mailing list
Bibdesk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


Re: [Bibdesk-users] Script hook to protect Address field

2010-04-03 Thread Peter Cowan
On Sat, Apr 3, 2010 at 3:26 AM, Fischlin  Andreas
andreas.fisch...@env.ethz.ch wrote:
 Dear Peter,

 Sorry, it is very difficult to understand what your actual problem is. First 
 I see no problem whatsoever in BD, nor in the bib file generated, nor in the 
 preview and most of all I do not understand why you try to do something with 
 AppleScripts. I base this conclusion on trying to repeat your problem using 
 your example. I can't.

I didn't mean to suggest that there was a problem with BD, more it was
a question about how I could further harness it's power to work around
another issue I was having.

 2) I clicked on BD's Import button and the record was correctly imported into 
 BD, no errors encountered, and all is as it should.  I see no problem there.

 3) The Address field contains the string PORTERS SOUTH, 4 CRINAN ST, LONDON 
 N1 9XW, ENGLAND correctly as it should be, though I don't like the 
 capitalization and you could edit that. But I guess that is beside the point.

 4) If I do (still in BD) menu command Window - TeX Preview I encounter no 
 errors and the opened preview window shows the record fine. Even the 
 capitalization problem is gone.

Did you try with the TeX preview Template I included in my previous email?

 So where is a problem?

 a) Do you want an AppleScript to edit any of the fields in that record? If 
 yes, why? What should be the purpose?

 b) Curly braces do not protect anything. We are not talking about shell 
 scripts, we have BibTeX encoded data stored on bib-files that are managed by 
 BD. Curly braces merely delimit the begin and end of fields in the records 
 and enclose the entire record. They serve any scanner to delimit information 
 and correctly interpret begin and end of records and fields. Moreover curly 
 braces may be used within fields to encode special characters, abbreviations, 
 macros etc. Ex.: Author = {Kurt G{\o}del}, Title = {The \TeX{}book}, . The 
 field author is very special, since it is treated into several subfields 
 automatically and uses for convenience reasons commas and optionally curly 
 braces to delimit its subfields. That may be the source for your 
 misinterpretation that you protect something with curly braces. See e.g. 
 Kopka  Daly, 2004, p. 235 for more on this.

 You write: However, this citation causes an error using my tex preview 
 template (below, require biblatex). The relevant part of the log is:

 Too many commas in name 1 of PORTERS SOUTH, 4 CRINAN ST, LONDON N1 9XW, 
 ENGLAND for entry cite-key

 This indicates that there is an error in your tex preview template. It seems 
 you entered the content of the address field into the author field or made 
 some other error causing such an interpretation by the BibTeX interpretation. 
  This has all absolutely nothing to do with curly braces nor AppleScripts 
 AFAIK. If my interpretation is correct, fix first your preview template so 
 that no longer any address information is interpreted as an author field.

 c) Have you indeed changed any templates? If yes, reverse that and your 
 problems might be gone. Writing a TeX paper using BibTeX will only need the 
 correctly stored bib file and should be independent from any preview 
 template. There seems to be nothing wrong in your case with all the software 
 components involved there, except for those you may have tampered with. You 
 may have altered preview templates or otherwise deviated from a default BD 
 installation or you have wrongly changed BibTeX styles you use in your TeX 
 setup.

Yes, as attached above, I did modify my TeX template, but I would
prefer to stick with the templates provided by biblatex which more
closely resemble the ones I use on a daily basis.

 d) Why writing a bug report? AFAI can see there is no bug anywhere in BD nor 
 its default templates as used by Preview, nor is there any real biblatex 
 problem involved. It seems you would have to write the bug report to 
 yourself. ;-)

I apologize that I wasn't clear, I'm not suggesting a bug in BD, but
there may be one in biblatex (which I use in my own TeX preview
template).

Thanks

Peter

 Hope this clarifies some of the issues.

 Regards,
 Andreas

 Cited References:
 
 Kopka, H.  Daly, P. W., 2004 (ed. 4). Guide to LaTeX. Addison-Wesley: 
 Boston, US. 597pp.     Ko089



 ETH Zurich
 Prof. Dr. Andreas Fischlin
 Systems Ecology - Institute of Integrative Biology
 CHN E 21.1
 Universitaetstrasse 16
 8092 Zurich
 SWITZERLAND

 andreas.fisch...@env.ethz.ch
 www.sysecol.ethz.ch

 +41 44 633-6090 phone
 +41 44 633-1136 fax
 +41 79 221-4657 mobile

             Make it as simple as possible, but distrust it!
 



 On 03/Apr/2010, at 00:34 , Peter Cowan wrote:

 On Fri, Apr 2, 2010 at 2:13 PM, Christiaan Hofman cmhof...@gmail.com wrote:

 On Apr 2, 2010, at 21:54, Peter Cowan wrote:

 On Fri, Apr 2, 2010 at 9:53 AM, Christiaan Hofman cmhof...@gmail.com 
 wrote

Re: [Bibdesk-users] Script hook to protect Address field

2010-04-03 Thread Peter Cowan
On Sat, Apr 3, 2010 at 10:29 AM, Christiaan Hofman cmhof...@gmail.com wrote:

 On Apr 3, 2010, at 18:01, Adam R. Maxwell wrote:


 On Apr 3, 2010, at 3:26 AM, Fischlin Andreas wrote:

 You write: However, this citation causes an error using my tex preview 
 template (below, require biblatex). The relevant part of the log is:

 Too many commas in name 1 of PORTERS SOUTH, 4 CRINAN ST, LONDON N1 9XW, 
 ENGLAND for entry cite-key

 This indicates that there is an error in your tex preview template.

 You apparently missed the part where he said he's using biblatex.  Standard 
 BibTeX has no problems with this, as you say.  A quick read of the biblatex 
 manual [1] indicates that it expects address to be a list separated by 
 and.  It almost sounds like biblatex is using BibTeX name parsing rules to 
 split a list of addresses, which seems…odd.

 [1] 
 http://www.ctan.org/tex-archive/macros/latex/exptl/biblatex/doc/biblatex.pdf


Christian,

I also read that in the biblatex manual.  It appears there are two
types of lists, one specifically for names and the other a general
list type.  Perhaps the wrong type of list is used for address.  In
any case, I need to take this up with the biblatex folks.   Oddly
enough it does work in a .tex file if it's complied using latexmk.pl.

 That's what I called a bug in biblatex earlier. IMHO.

Agreed, as soon as I can confirm that no one else has filed the issue, I will.

Thanks

Peter

 Christiaan


 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Bibdesk-users mailing list
 Bibdesk-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/bibdesk-users


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Bibdesk-users mailing list
Bibdesk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


Re: [Bibdesk-users] Script hook to protect Address field

2010-04-02 Thread Peter Cowan
On Fri, Apr 2, 2010 at 9:53 AM, Christiaan Hofman cmhof...@gmail.com wrote:

 On Apr 1, 2010, at 23:29, Peter Cowan wrote:

 On Thu, Apr 1, 2010 at 2:03 PM, Christiaan Hofman cmhof...@gmail.com wrote:

 On Apr 1, 2010, at 22:15, Peter Cowan wrote:

 I'm using biblatex in the TeX preview window.  And, since I often
 import directly from ISI using the Web of Science Search function, I
 get regular errors related to commas in the address or institution
 field.  Perhaps there is a solution through biblatex to this problem,
 but I'm fine with either protecting or deleting the
 Address/Institution field on import.

 Script hooks seem like the perfect solution to this problem, but I am
 not an applescript users.  I've tried to cobble something together
 based on the available example and got the following which doesn't
 appear to work, on import (from Web of Science) nothing happens no
 errors no braces.  Any nudges in the right direction are appreciated.

 I apologize if this has been discussed on the list before, my searches
 did not reveal anything aside from confirmation of the biblatex TeX
 preview issue.

 Cheers

 Peter

 [snip old code]

 This won't work, because you call the external scripts outside the perform 
 BibDesk action... handler. The script hook will only call that handler, so 
 anything outside it (like defining the protectLib and errorLib) will be 
 ignored. Therefore reference to those external scripts will fail. You'll 
 have to move everything to inside the script hook handler.

 Christiaan,

 Thanks for the reply, I've moved the load script calls inside of the
 handler, but alas it still doesn't work.  The current version is
 below.

 I apologize for being such an applescript newb, but is there a
 workflow you follow for developing this applescripts, e.g. debugging
 hints, setting breakpoints etc.

 Cheers

 Peter


 [snip]

 BTW, another possibility is that this actually works, but you expect it to do 
 something different from what it actually does. What this most certainly does 
 NOT do is to enclose the Address value in braces, and the check you added 
 make me think that that's what you (wrongly) expect it to do. So perhaps you 
 should also say what you expect it to do, and what you did exactly to make it 
 do that, perhaps with explicit samples.

Christian and Fischlin,

Thanks for your replies.   Indeed I'm trying to wrap the Address Field
in curly braces so that biblatex won't puke on those bib items.  I
thought that wrapping something in braces was called protecting, but
perhaps I am wrong.

You are correct the above script most definitely did not do what I was
hoping for.

An explicit example:

I usually use the Web of Science SCI search to import references.  If
I search for au=(watson AND crick) the first hit is

CRICK, FHC and WATSON, JD. 1956. STRUCTURE OF SMALL VIRUSES. Nature.
177(4506):473-475.

However, this citation causes an error using my tex preview template
(below, require biblatex).  The relevant part of the log is:

Too many commas in name 1 of PORTERS SOUTH, 4 CRINAN ST, LONDON N1
9XW, ENGLAND for entry cite-key

If I change the address field to

{PORTERS SOUTH, 4 CRINAN ST, LONDON N1 9XW, ENGLAND}

it is compiled and previewed correctly.

The applescript I sent before was an effort to do that wrapping on
import.  I however was unable to get the protectLib to work at all so
I ended up with this *working* script hook.  A couple of caveats, the
errorLib has never produced anything to me, it seem unlikely given my
applescript skills, that I produced no errors.  And, secondly this
method won't, of course, catch cases where the field is already in
braces, so some Address fields could end up double wrapped.
Suggestions for improvements are welcome.

property theFieldToSet : Address

using terms from application BibDesk
  on perform BibDesk action with publications thePubs for script hook
theScriptHook

set errorLib to (load script file ¬
  ((path to home folder as string) 
Library:ScriptingAdditions:Error Reporting.scpt))
-- we only report all errors at the end

tell errorLib
  delayReportErrors()
  set its defaultErrorFileName to BibDeskScriptErrors
end tell

repeat with thePub in thePubs
  try
tell thePub
  set curValue to value of field theFieldToSet

  set newValue to {  curValue  }
  if newValue is not {} then ¬
set value of field theFieldToSet to newValue
end tell

  on error errorMessage number errorNumber
tell errorLib to reportError(errorMessage, errorNumber)
  end try
end repeat
  end perform BibDesk action with publications
end using terms from

-- see if we had any errors
tell errorLib to checkForErrors()


%% TeX Preview template %
%% Requires biblatex 

\documentclass[letterpaper]{article}
\usepackage[natbib, style=authoryear]{biblatex}
\pagestyle{empty}
\textwidth =  6.5in
\voffset

Re: [Bibdesk-users] Script hook to protect Address field

2010-04-02 Thread Peter Cowan
On Fri, Apr 2, 2010 at 2:13 PM, Christiaan Hofman cmhof...@gmail.com wrote:

 On Apr 2, 2010, at 21:54, Peter Cowan wrote:

 On Fri, Apr 2, 2010 at 9:53 AM, Christiaan Hofman cmhof...@gmail.com wrote:

 On Apr 1, 2010, at 23:29, Peter Cowan wrote:

 On Thu, Apr 1, 2010 at 2:03 PM, Christiaan Hofman cmhof...@gmail.com 
 wrote:

 On Apr 1, 2010, at 22:15, Peter Cowan wrote:

 I'm using biblatex in the TeX preview window.  And, since I often
 import directly from ISI using the Web of Science Search function, I
 get regular errors related to commas in the address or institution
 field.  Perhaps there is a solution through biblatex to this problem,
 but I'm fine with either protecting or deleting the
 Address/Institution field on import.

 Script hooks seem like the perfect solution to this problem, but I am
 not an applescript users.  I've tried to cobble something together
 based on the available example and got the following which doesn't
 appear to work, on import (from Web of Science) nothing happens no
 errors no braces.  Any nudges in the right direction are appreciated.

 I apologize if this has been discussed on the list before, my searches
 did not reveal anything aside from confirmation of the biblatex TeX
 preview issue.

 Cheers

 Peter

 [snip old code]

 This won't work, because you call the external scripts outside the 
 perform BibDesk action... handler. The script hook will only call that 
 handler, so anything outside it (like defining the protectLib and 
 errorLib) will be ignored. Therefore reference to those external scripts 
 will fail. You'll have to move everything to inside the script hook 
 handler.

 Christiaan,

 Thanks for the reply, I've moved the load script calls inside of the
 handler, but alas it still doesn't work.  The current version is
 below.

 I apologize for being such an applescript newb, but is there a
 workflow you follow for developing this applescripts, e.g. debugging
 hints, setting breakpoints etc.

 Cheers

 Peter


 [snip]

 BTW, another possibility is that this actually works, but you expect it to 
 do something different from what it actually does. What this most certainly 
 does NOT do is to enclose the Address value in braces, and the check you 
 added make me think that that's what you (wrongly) expect it to do. So 
 perhaps you should also say what you expect it to do, and what you did 
 exactly to make it do that, perhaps with explicit samples.

 Christian and Fischlin,

 Thanks for your replies.   Indeed I'm trying to wrap the Address Field
 in curly braces so that biblatex won't puke on those bib items.  I
 thought that wrapping something in braces was called protecting, but
 perhaps I am wrong.

 You are correct the above script most definitely did not do what I was
 hoping for.

 An explicit example:

 I usually use the Web of Science SCI search to import references.  If
 I search for au=(watson AND crick) the first hit is

 CRICK, FHC and WATSON, JD. 1956. STRUCTURE OF SMALL VIRUSES. Nature.
 177(4506):473-475.

 However, this citation causes an error using my tex preview template
 (below, require biblatex).  The relevant part of the log is:

 Too many commas in name 1 of PORTERS SOUTH, 4 CRINAN ST, LONDON N1
 9XW, ENGLAND for entry cite-key

 If I change the address field to

 {PORTERS SOUTH, 4 CRINAN ST, LONDON N1 9XW, ENGLAND}

 it is compiled and previewed correctly.


 That sounds like a totally different problem. The warning says it's 
 interpreting this as a name. So either you've put the address in an author 
 field or something, or biblatex has a problem. It should never interpret an 
 address as a name IMHO.

This is from a direct import using the Import button while searching
WOS from bibdesk.  I agree it seems like a biblatex problem to me, but
I've not found mention of it on the biblatex list, I may send a bug
report that way.

This is the how the above example is imported by BibDesk:

@article{CRICK.F:1956,
Address = {PORTERS SOUTH, 4 CRINAN ST, LONDON N1 9XW, ENGLAND},
Author = {CRICK, FHC and WATSON, JD},
Date-Added = {2010-04-02 15:28:17 -0700},
Date-Modified = {2010-04-02 15:28:17 -0700},
Isi = {A1956ZQ08700022},
Isi-Recid = {3737785},
Isi-Ref-Recids = {1399833 25231 154301 694402 25230 239834 3611023
3395518 3500753 3437398 176937 3474554 175967 2741553 137080 43856
3395520 3397795 3437394 3742607 103203 3611269 2741574 3395809 3397793
261765 3649114 665053 3742608 2741559 3742609 482156},
Journal = {Nature},
Number = {4506},
Pages = {473-475},
Publisher = {MACMILLAN MAGAZINES LTD},
Times-Cited = {327},
Title = {STRUCTURE OF SMALL VIRUSES},
Volume = {177},
Year = {1956},
Bdsk-Url-1 = 
{http://gateway.isiknowledge.com/gateway/Gateway.cgi?GWVersion=2SrcAuth=AlertingSrcApp=AlertingDestApp=WOSDestLinkType=FullRecord;KeyUT=A1956ZQ08700022}}

 The applescript I sent before was an effort to do that wrapping

[Bibdesk-users] Script hook to protect Address field

2010-04-01 Thread Peter Cowan
I'm using biblatex in the TeX preview window.  And, since I often
import directly from ISI using the Web of Science Search function, I
get regular errors related to commas in the address or institution
field.  Perhaps there is a solution through biblatex to this problem,
but I'm fine with either protecting or deleting the
Address/Institution field on import.

Script hooks seem like the perfect solution to this problem, but I am
not an applescript users.  I've tried to cobble something together
based on the available example and got the following which doesn't
appear to work, on import (from Web of Science) nothing happens no
errors no braces.  Any nudges in the right direction are appreciated.

I apologize if this has been discussed on the list before, my searches
did not reveal anything aside from confirmation of the biblatex TeX
preview issue.

Cheers

Peter

set protectLib to (load script file ¬
((path to home folder as string)  Library:Application
Support:BibDesk:Scripts:Add Protect Strings.scpt))
-- load the Error Reporting script library
set errorLib to (load script file ¬
((path to home folder as string)  Library:ScriptingAdditions:Error
Reporting.scpt))
-- we only report all errors at the end
tell errorLib
delayReportErrors()
set its defaultErrorFileName to BibDeskScriptErrors
end tell

property theFieldToSet : Address

using terms from application BibDesk
on perform BibDesk action with publications thePubs for script hook
theScriptHook

-- here you could return depending on theName or theField
tell protectLib
-- protect chars between balanced {}
set its startProtectChar to {
set its endProtectChar to }

repeat with thePub in thePubs

try
tell thePub
set curValue to value of field 
theFieldToSet
-- generate a new value for the 
field
set theField to field 
theFieldToSet
set newValue to 
protectString(curValue)
if newValue is not {} then ¬
set value of theField 
to newValue
end tell

on error errorMessage number errorNumber
tell errorLib to 
reportError(errorMessage, errorNumber)

end try

end repeat
end tell --protectLib

end perform BibDesk action with publications
end using terms from

-- see if we had any errors
tell errorLib to checkForErrors()

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Bibdesk-users mailing list
Bibdesk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


Re: [Bibdesk-users] Script hook to protect Address field

2010-04-01 Thread Peter Cowan
On Thu, Apr 1, 2010 at 2:03 PM, Christiaan Hofman cmhof...@gmail.com wrote:

 On Apr 1, 2010, at 22:15, Peter Cowan wrote:

 I'm using biblatex in the TeX preview window.  And, since I often
 import directly from ISI using the Web of Science Search function, I
 get regular errors related to commas in the address or institution
 field.  Perhaps there is a solution through biblatex to this problem,
 but I'm fine with either protecting or deleting the
 Address/Institution field on import.

 Script hooks seem like the perfect solution to this problem, but I am
 not an applescript users.  I've tried to cobble something together
 based on the available example and got the following which doesn't
 appear to work, on import (from Web of Science) nothing happens no
 errors no braces.  Any nudges in the right direction are appreciated.

 I apologize if this has been discussed on the list before, my searches
 did not reveal anything aside from confirmation of the biblatex TeX
 preview issue.

 Cheers

 Peter

[snip old code]

 This won't work, because you call the external scripts outside the perform 
 BibDesk action... handler. The script hook will only call that handler, so 
 anything outside it (like defining the protectLib and errorLib) will be 
 ignored. Therefore reference to those external scripts will fail. You'll have 
 to move everything to inside the script hook handler.

Christiaan,

Thanks for the reply, I've moved the load script calls inside of the
handler, but alas it still doesn't work.  The current version is
below.

I apologize for being such an applescript newb, but is there a
workflow you follow for developing this applescripts, e.g. debugging
hints, setting breakpoints etc.

Cheers

Peter


property theFieldToSet : Address

using terms from application BibDesk
on perform BibDesk action with publications thePubs for script hook
theScriptHook

set protectLib to (load script file ¬
((path to home folder as string)  Library:Application
Support:BibDesk:Scripts:Add Protect Strings.scpt))
-- load the Error Reporting script library
set errorLib to (load script file ¬
((path to home folder as string) 
Library:ScriptingAdditions:Error Reporting.scpt))
-- we only report all errors at the end

tell errorLib
delayReportErrors()
set its defaultErrorFileName to BibDeskScriptErrors
end tell

-- here you could return depending on theName or theField
tell protectLib
-- protect chars between balanced {}
set its startProtectChar to {
set its endProtectChar to }

repeat with thePub in thePubs

try
tell thePub
set curValue to value of field 
theFieldToSet
-- generate a new value for the 
field
set theField to field 
theFieldToSet
set newValue to 
protectString(curValue)
if newValue is not {} then ¬
set value of theField 
to newValue
end tell

on error errorMessage number errorNumber
tell errorLib to 
reportError(errorMessage, errorNumber)

end try

end repeat
end tell --protectLib

end perform BibDesk action with publications
end using terms from

-- see if we had any errors
tell errorLib to checkForErrors()

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Bibdesk-users mailing list
Bibdesk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


Re: [Bibdesk-users] Is there a way to set a 'flag' for one or more publications

2009-05-26 Thread Peter Cowan
On Mon, May 25, 2009 at 6:42 PM, David Nicholls da...@mso.anu.edu.au wrote:
 In (eg) Thunderbird it's possible to set a small flag icon on particular
 emails, making them easy to find.

 Is there a way to set flags for particular publications in Bibdesk?


Check the Fields section of the preferences

HTH

Peter

 It would also be useful to set a printed hard copy flag.

 Thanks

 DN
 --
 __
 ANU RSAA Mt Stromlo

 --
 Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
 is a gathering of tech-side developers  brand creativity professionals. Meet
 the minds behind Google Creative Lab, Visual Complexity, Processing, 
 iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
 Group, R/GA,  Big Spaceship. http://www.creativitycat.com
 ___
 Bibdesk-users mailing list
 Bibdesk-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/bibdesk-users


--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers  brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing,  
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA,  Big Spaceship. http://www.creativitycat.com 
___
Bibdesk-users mailing list
Bibdesk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


Re: [Bibdesk-users] Send via Email

2009-03-05 Thread Peter Cowan
Thanks! It works perfectly now.  What a great feature.

On Thu, Mar 5, 2009 at 2:31 AM, Christiaan Hofman cmhof...@gmail.com wrote:
 Thanks, that should be fixed in the current nightly.

 Christiaan

 On 5 Mar 2009, at 1:57 AM, Peter Cowan wrote:

 First, thanks to the developers for all the time and effort they put
 into developing and improving BibDesk.

 I notice that when I select a publication and choose Send via Email
 nothing happens.  Mail.app is set as my default mail program as per
 the help and the following is reported to the console.

 3/4/09 4:27:25 PM BibDesk[427] Error compiling mail to script: {
    NSAppleScriptErrorBriefMessage = Expected \U201c:\U201d but found
 property.;
    NSAppleScriptErrorMessage = Expected \U201c:\U201d but found
 property.;
    NSAppleScriptErrorNumber = -2741;
    NSAppleScriptErrorRange = NSRange: {185, 4};
 }

 I'm using a recently nightly of  BibDesk on mac os x 10.5.6.

 Is this a bug, or a problem with my setup?

 Peter


 --
 Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
 -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
 -Strategies to boost innovation and cut costs with open source participation
 -Receive a $600 discount off the registration fee with the source code: SFAD
 http://p.sf.net/sfu/XcvMzF8H
 ___
 Bibdesk-users mailing list
 Bibdesk-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/bibdesk-users


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Bibdesk-users mailing list
Bibdesk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


[Bibdesk-users] Send via Email

2009-03-04 Thread Peter Cowan
First, thanks to the developers for all the time and effort they put
into developing and improving BibDesk.

I notice that when I select a publication and choose Send via Email
nothing happens.  Mail.app is set as my default mail program as per
the help and the following is reported to the console.

3/4/09 4:27:25 PM BibDesk[427] Error compiling mail to script: {
NSAppleScriptErrorBriefMessage = Expected \U201c:\U201d but found
property.;
NSAppleScriptErrorMessage = Expected \U201c:\U201d but found property.;
NSAppleScriptErrorNumber = -2741;
NSAppleScriptErrorRange = NSRange: {185, 4};
}

I'm using a recently nightly of  BibDesk on mac os x 10.5.6.

Is this a bug, or a problem with my setup?

Peter

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Bibdesk-users mailing list
Bibdesk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


Re: [Bibdesk-users] o/t question re: SVN

2008-07-09 Thread Peter Cowan
I use mercurial, mostly because before leopard it was easiest to get a
repository up and running on.  Leopard comes with SVN so this is less
true now.  As for latex specific diff I've had luck with both of
these.

http://www.jpaisley.com/software/ruby/rb-latex-diff/
http://www.robmar.net/TexDiff/

Peter

On Wed, Jul 9, 2008 at 12:19 PM, Mark Eli Kalderon [EMAIL PROTECTED] wrote:

 This is a bit off-topic but I have been thinking about using
 subversion to manage versioning etc. on several writing projects.
 Everything I've seen seems to be oriented towards team / multi-user
 scenarios but it also seems that people use it for single-authored
 projects.  Stephan (and others!) , do you have any recommendations on
 SVN workflow, helper apps, shortcomings etc?  Prefs. for SVN vs.
 Mercurial or other alternatives?
 thanks
 Derick

 Multi-user workflows are readily adaptable to the single user if you
 work at multiple sites (at home and at work, say). If you have a
 repository on a server somewhere, you can access your files (and their
 histories!) wherever you are.

 I used to use subversion. Now I use git. Most of the problems that I
 had with subversion had to doing with merging. These have been
 addressed in subversion 1.5.

 However, a case can be made for using distributed version control such
 as git or mercurial especially wrt BibTeX files---to facilitate
 sharing. See:

 http://markelikalderon.com/blog/2008/06/17/gitting-bibtex/
 http://orgtheory.wordpress.com/2008/06/29/git-bibs/

 All the best, Mark

 -
 Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
 Studies have shown that voting for your favorite open source project,
 along with a healthy diet, reduces your potential for chronic lameness
 and boredom. Vote Now at http://www.sourceforge.net/community/cca08
 ___
 Bibdesk-users mailing list
 Bibdesk-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/bibdesk-users


-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
Bibdesk-users mailing list
Bibdesk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


Re: [Bibdesk-users] Feature-Request regarding auto-filing and auto-generation of cite-keys

2008-03-18 Thread Peter Cowan
Your specific case can partially be achieved with %P, see [^1].  As
far as I know there is no if/then operator (and I think no plans to
add one).

[1] http://bibdesk.sourceforge.net/manual/BibDesk%20Help_90.html#SEC157

HTH

Peter

On Mon, Mar 17, 2008 at 11:57 PM, Niels Kobschaetzki
[EMAIL PROTECTED] wrote:
 Hi!

  I have sometimes the problem that I have some work that is from an
  organization w/out any author. While I am able to put in the
  organization it would be great that if a cite-key is auto-generated or
  a file auto-filed that there are options for an if/then-operator.
  Something like: If there are no authors, try to use the editors-field,
  if there aren't authors or editors use the organization field for the
  cite-key and the auto-filing.

  Niels

  -
  This SF.net email is sponsored by: Microsoft
  Defy all challenges. Microsoft(R) Visual Studio 2008.
  http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
  ___
  Bibdesk-users mailing list
  Bibdesk-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/bibdesk-users


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bibdesk-users mailing list
Bibdesk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


Re: [Bibdesk-users] BibDesk and Papers

2008-03-18 Thread Peter Cowan
  Bibdesk is nice for manage my references (and getting a good bib-file
  out of it) and pdfs in the file-system but it is missing the full-text
  search over the pdfs like Papers is doing and it gets the whole
  web-search thing more nicely done than Bibdesk (like automatically
  search for the most recent papers from the selected author or from the
  journal and stuff like that) and the interface just looks overall
  quite nice.

Bibdesk has full content searching,  when I type something into the
search bar File Content comes up along with Title, Author etc.
It's a bit slow the first time as it builds the search index, but fast
afterwards (is it cached at all after quit?).  I've been using the
nightly build for a while, perhaps this isn't in the release version
yet?

Peter

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bibdesk-users mailing list
Bibdesk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


Re: [Bibdesk-users] BibDesk and Papers

2008-03-18 Thread Peter Cowan
On Tue, Mar 18, 2008 at 12:55 AM, Niels Kobschaetzki
[EMAIL PROTECTED] wrote:

 On Tue, Mar 18, 2008 at 8:50 AM, Peter Cowan [EMAIL PROTECTED] wrote:
 Bibdesk is nice for manage my references (and getting a good bib-file
  out of it) and pdfs in the file-system but it is missing the full-text
  search over the pdfs like Papers is doing and it gets the whole
  web-search thing more nicely done than Bibdesk (like automatically
  search for the most recent papers from the selected author or from the
  journal and stuff like that) and the interface just looks overall
  quite nice.
  
Bibdesk has full content searching,  when I type something into the
search bar File Content comes up along with Title, Author etc.
It's a bit slow the first time as it builds the search index, but fast
afterwards (is it cached at all after quit?).  I've been using the
nightly build for a while, perhaps this isn't in the release version
yet?

  You are right…well, it never occured to me that the file content is
  searched as well…
  well it seems then that only the nicer interface and the way the
  web-search stuff works are only points for Papers

I've never used Papers before, would you mind explaining what it is
that you like and how it differs from BibDesk?

Peter

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bibdesk-users mailing list
Bibdesk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


Re: [Bibdesk-users] web group problems

2007-11-03 Thread Peter Cowan
On 11/3/07, Adam R. Maxwell [EMAIL PROTECTED] wrote:

 On Nov 3, 2007, at 4:21 PM, Adam R. Maxwell wrote:

  starting a new thread
 
  On Nov 3, 2007, at 4:06 PM, Adam M.Goldstein wrote:
 
  Next question: I do a search, and I am looking at a google scholar
  search page in the upper part of the window, and the scraped-off
  bibtex records in the bottom part. Then, I go to the next page of the
  search by selecting the 2 at the bottom of the page for page 2 of
  the search. But the BibTeX at the bottom of the window stays the
  same.
  How do I get the new references on page 2?
 
  What do you mean by BibTeX?  I see the usual publications table and
  whatever preview I've selected.  The new references should be
  automatically loaded up, and they are in my test here.

 The Google Scholar scraper would fail to load an entire page if it
 encountered a single bad reference, but this should be fixed for the
 next nightly build.  Hopefully that fixes the random load failures
 we've seen with it.

The web group, now works here.  I had to quit and restart BibDesk but
it now works perfectly.  Google scholar loads quickly and changes the
references here.  Thanks for the quick response.

I'll download the next nightly and continue testing.

Peter

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Bibdesk-users mailing list
Bibdesk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


[Bibdesk-users] Persistent search groups

2007-08-17 Thread Peter Cowan
Hello,

Thanks to the developers for adding Web of Science searching, between
this and Alex's excellent OpenURL script I use a web browser far less
and have a much more organized collection of references!

I understand WOS searching is new so perhaps what I want already
exists and I haven't found it.

What I want is for an empty WOS search group to remain persistently
(e.g. from launch to launch) in the group sidebar.  I use it for
different searches almost every time I launch Bibdesk, and I'd rather
not select it from the menu every time (though I could give it a
shortcut which would be a workable solution).

I am also confused by the following line on the Bibdesk wiki:


 You can also permanently add a search group added using 1. to the list of 
 default search groups. Choose the Edit-Get Info menu item with the search 
 group selected, or double-click on its icon, and hit the Add button.


I don't see an 'add' button, what am I doing incorrectly.

Thank in advance,

Peter

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Bibdesk-users mailing list
Bibdesk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-users