As discussed before, this is a simple one line script to get it: #!/bin/bash echo "$1" | base64 -D | plutil -convert xml1 -o - -- - This will give the plist in xml format with the relativePath rather easily figured out. You could also type this on a command line with the bask-file value inserted in the place of $1 I also attach an extension to Adam's read_bdsk_file.py that can read both the old and the new format. Christiaan |
#!/usr/bin/python # # Attempt to read relative path from BibDesk Bdsk-File fields. # Useful only for debugging, since the archive format may change. # # Call as `echo "xxxx" | python read_bdsk_file.py` where "xxxx" is the content of a # Bdsk-File field. Alternately, copy and use `pbpaste | python read_bdsk_file.py`. #
import os, sys import base64 from Foundation import * # read base64 data from standard input and decode decodedBytes = base64.b64decode(sys.stdin.read()) nsData = NSData.dataWithBytes_length_(decodedBytes, len(decodedBytes)) plist, fmt, error = NSPropertyListSerialization.propertyListFromData_mutabilityOption_format_errorDescription_(nsData, 0, None, None) if plist is None: print "failed to decode archive due to error %s" % (error) exit(1) # currently an implementation detail; may not be at position 6 in future if ("relativePath" in plist): print plist["relativePath"] elif ("$objects" in plist and len(plist["$objects"]) > 4): print plist["$objects"][4] else: print "unknown format for property list %s" % (str(plist))
|
_______________________________________________ Bibdesk-users mailing list Bibdesk-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bibdesk-users