I have a nearly working version of a "Calendar View" applescript, but  
I am still getting errors with BibDesk v1040 (the latest nightly that  
works for me).  Everything works up until the line where I add a  
publication to a newly created group, then it generates a NSInternal  
Script Error.

(On testing, I also get an error trying to use the sample script  
included with BD).

tell application "BibDesk"
        tell document 1
                set startDateList to {}
                set endDateList to {}
                set thisYear to year of (current date)
                repeat with i from 0 to (52 * (thisYear - 2001) * weeks) by (28 
*  
days) --build lists of start/end dates, back to 2001
                        set startDate to ((current date) - (i + (27 * days)))
                        set time of startDate to 0
                        set startDateList to startDateList & {startDate}
                        set endDate to ((current date) - i)
                        set time of endDate to 0
                        set endDateList to endDateList & {endDate}
                end repeat
                
                set i to length of startDateList
                repeat with n from 1 to i
                        --get the contents for the new group
                        set thePublications to (every publication whose added 
date is less  
than or equal to item n of endDateList and added date is greater than  
item n of startDateList)
                        --create the name for the group
                        set endDate to item n of endDateList
                        set theName to month of endDate & " " & day of endDate 
& ", " &  
year of endDate & " to " as string
                        set startDate to item n of startDateList
                        set theName to theName & month of startDate & " " & day 
of  
startDate & ", " & year of startDate as string
                        -- create the group, but only if there are publications 
in that  
date range
                        if thePublications is not {} then set targetGroup to 
make new  
static group with properties {name:theName} at end of every group
                        repeat with thePub in thePublications
                                add thePub to targetGroup --generates 
NSInternal Script Error :(
                        end repeat
                end repeat
        end tell
end tell

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

Reply via email to