On 2008-August-06  , at 14:58 , Maxwell, Adam R wrote:

>> On 2008-August-06  , at 13:59 , jiho wrote:
>>
>>> Now when I use the command "Bibdesk Do Completion" I get:
>>> /tmp/temp_textmate.UNeFiD:18: undefined method `[]' for
>>> nil:NilClass (NoMethodError)
>>
>>
>> However, using "Build cite with Bibdesk", the completion works. If
>> that helps.
>
> That's odd, since they should be doing the same thing.  Can you post  
> the
> BibDesk DO Completion .tmCommand script?  It's working fine for me  
> with
> latest TextMate and svn checkout of bundles.

I'll try updating my bundles and support directory to svn versions too.

I just reinstalled the tmCommand too so it should be the same version  
you have apart from the location of the binary. Here it is:

#!/usr/bin/env ruby -wKU

# for TextMate.exit
require ENV["TM_SUPPORT_PATH"] + "/lib/exit_codes.rb"
require ENV["TM_SUPPORT_PATH"] + "/lib/ui.rb"

SUPPORT = ENV['TM_SUPPORT_PATH']
DIALOG = ENV['DIALOG']

require SUPPORT + '/lib/escape'
require SUPPORT + '/lib/osx/plist'

searchTerm = STDIN.read

latexMaster = ENV['TM_LATEX_MASTER']

# see if latex master is relative
if latexMaster[1,1] != "/" then
   # try to find a base directory
   projectDir = ENV['TM_PROJECT_DIRECTORY']
   if projectDir == ""
     projectDir = ENV['TM_DIRECTORY']
   end
   if projectDir != ""
     latexMaster = projectDir + "/" + latexMaster
   end
end

# omit -s to return all items
CMD = '"$HOME"/Library/Application\ Support/TextMate/Support/ 
BibDeskTMCompletions ' + (searchTerm == "" ? "" : "-s #{searchTerm}")  
+ ' -t "$TM_FILEPATH" ' + latexMaster

# returns an XML plist
plist = `#{CMD}`

# cribbed from example on pastie
res = OSX::PropertyList::load(`#{e_sh DIALOG} -up #{e_sh plist}`)

# this keeps us from overwriting on cancel
TextMate.exit_discard unless res.has_key? 'selectedMenuItem'

# insert valueForKey:@"citeKey"
print res['selectedMenuItem']['citeKey']


JiHO
---
http://jo.irisson.free.fr/



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bibdesk-users mailing list
Bibdesk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Reply via email to