From: Nairn John <johnana...@gmail.com>
Date: Mon, 4 Jul 2011 16:37:06 +0200
Local: Mon, Jul 4 2011 10:37 am
Subject: Re: Search for Living Relatives born after a certain date
I am not exactly sure what the goal of the scripts are, but I expect you are not getting what you want with comparisons like if bday > "01 01 1915" then This is doing a string comparison and Apple Script will not recognize the strings as dates and therefore will not compare them as dates; they will rank in alphabetical order. Furthermore, the property "birth date" will return the date in GEDCOM format so it will be something like "12 NOV 1934" and not numbers (you can get numbers if you want by using date format conversions). If you are trying to do date comparisons, you should always be using date SDNs (for serial day numbers). These are day numbers assigned to dates (starting from about 4000 BC). You can compare SDNs (because they are numbers) and it will work for any calendar (because the date is converted to a number). You probably want something like set sdnRange to sdn range full date "1 JAN 1915" I did not test this in Script editor, but I think the basic ideas are correct. The first line converts date "1 JAN 1915" to an sdnRange in a list. Since it is an exact date, the list will have two identical numbers. The next line loads the first item into a variable. Now when looking at the individual, grab the birth SDN (and not the date text). This SDN can be compared to the one calculated in minSDN. If the birth date is not an exact date (e.g., 1934), the "birth SDN" property will give the minimum possible SDN (for "1934" it would be SDN for "1 JAN 1934). If it matters, you can retrieve the "birth SDN max" as well which has the maximum possible SDN for non-exact dates (for "1934" it would be SDN for "31 DEC 1934"). The second script also has some errors. It does an age calculation only if death date is empty. But that means there is no death date. The property death SDN will therefore return 0 (which for SDNs means no date or an invalid date). The age calculation will thus give birth SDN/365.25 which will always be very large numbers (around 6000 for people born in 20th century). Once inside the conditional (as corrected above) you probably want set dday to death date SDN For a refinement, you might want to use (death SDN max - birth SDN) / 365.25, which will catch everyone that could have been 80 when they died (i.e., age calculated from maximum number of days they were alive based on recorded date information). Or possibly (death SDN - birth SDN max) / 365.25 , which will only catch those that were certainly over than 80 based on records date information (i.e., age calculated from minimum possible days they were alive). To see some date calculations in action, you can look at the "Age Analysis Report" script (you can open it for viewing by selecting in from the scripts menu in GEDitCOM II while holding down the option key). On Jul 3, 2011, at 7:59 PM, daa wrote: > OK, so I have been looking at some of the canned scripts and have come up with the following (snippet from a longer version) that works, almost, it gets dates in the 1800's. I'm a little confused as to how the dates are handled apparently. Any ideas? ------------ > tell item i of indisRef > I was also playing around with this: > tell item i of indisRef John Nairn http://www.geditcom.com Genealogy Software for the Mac You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||