Reports - Keystrokes?

74 views
Skip to first unread message

David

unread,
Feb 22, 2024, 12:25:22 PMFeb 22
to GEDitCOM II Discussions
Can anyone help?
Trouble with Extensions > Reports and GeditComII not allowed to send keystrokes. GeditComII has full disk access + toggled on in the Accessibility control list. Another setting I am missing?

David

John Nairn, Developer

unread,
Feb 22, 2024, 12:47:21 PMFeb 22
to GEDitCOM II Discussions
I can run extension in the Extensions>Reports submenu without problems. What is happening regarding key strokes? Is this 3.1, build 3 (just posted).

i did get an error running Extensions>Reports>Age Analysis and choosing "Normalized Lifespan Analysis." That report is one I tried where I normalized lifespans to the expected life span at their time of death. It turned out biologically to be a very poor normalization. The problem with humans is that while life expectancy as increased from the 40s to the 70s since the 1800s, the maximum life span has not increased. In other words, people did live into their 80s in the 1800s (or double the life expectancy), but no one today lives to 140s (or double the current lifespan). The normalized report gave unrealistic expectations.

I gave up on the report and deleted it, but forgot to remove it as an option in the extension. To fix that:

1. Open AgeAnalysisReports.gplug in GEDitCOM Editor (hold down option key while selecting "Age Analysis Reports" from the extensions menu)
2. Expand "Properties" section and click on "main choices"
3. Delete the "Normalized Lifespan Analysis" line and save the extension

John Nairn

David

unread,
Feb 23, 2024, 3:24:37 AMFeb 23
to GEDitCOM II Discussions
GeditCom Beta did not report to Pages - I accepted as a beta issue and ignored the XCode Toolbox missing dialog. GeditCom 3.1(3) fixes that - opens Pages - fails with the keystrokes warning. Relevant screenshots attached and I would be interested to know what apps should appear in the Computer Control list.

Descendants Report.png

Control Applications.png

David

unread,
Feb 23, 2024, 5:18:23 AMFeb 23
to GEDitCOM II Discussions
Additional - Ahnentafel Report below. CLT is about 723MB - required for reporting?

XCode Tools.png

Python Tools.png

John Nairn, Developer

unread,
Feb 23, 2024, 2:25:18 PMFeb 23
to GEDitCOM II Discussions
You are seeing issues with Pages and with using Python. Here are some ideas:

1. The option to get "Descendants by Generations" in a Pages document is an AppleScript and was written many years ago to work with Pages 4 (Pages in now at 12 o4 higher). The first script stopped working in Pages 5 because Apple decided it was a good idea to remove almost all support for Apple Script in Pages. I think the approach is to make the Pages on MacOS as close as possible to Pages on iPhone and to do that, they had to make MacOS version much more limiting.

This change caused the initial script to stop working. I was repaired by a kind GEDitCOM II user who found a work around to Pages not support AppleScript by using a low-level method that opens Pages and send key strokes. I don't know how it works or what would stop it, but it has worked for me. I just tried in Ventura 13.0.1 with Pages 12 and it worked for me. You might be getting something different in Somoma 14.3.1 and whatever Pages version you have. It also possible Apple no prevents Pages from receiving key strokes. Mac apps can set whether or not they are scriptable. Through Pages 12 at least, scripting was very limited, but it allow scripted key strokes. It is possible the latest version has turned of scripting entirely. In brief, it is an issue that GEDitCOM II does not have control over. You might try google Pages getting key strokes and see if still allowed. It could need a different System setting or a Pages setting or might be impossible (i.e. Apple has ruled key strokes to be a security issue in now blocks them).

You should be able get a good report in a window (using the "Standard report in a GEDitCOM II" window" option. That uses my internal scripting language which does not give Apple a chance to block anything. Once done, you can use "Export" submenu to save as a html file. That file can be opened in browsers and other software (but it seems Pages cannot open html files, but MS Word can). If you have MS Word, you save report in Word document (that still works for me an MS Word still supports AppleScript). If you then want in Pages, save the word document and open in Pages.

I will test myself using Sonoma 14.3.1 later (computer is not with me now) to see if I have same issue and if I can solve it. I can't test now because MacOS I have now does not have that problem.

2. The Ahnentafel report is in Python. First, you should normally using the built in "Ancestors (Ahnentafel)" in the "Reports" menu to get that report. It is identical to the one the Extensions menu. The only reason I provided an extension that does the same report is that users could then edit the extension and change the way to formats the report. That is an advanced option, but possible with extension using the GEDitCOM Editor, but only useful if you do not like all the built in options. The built-in report also has many options to change the report style.

A second issue that the report is in Python (I have not converted it to internal script yet). Apple used to include python in MacOS, but decided to remove it starting in Monterrey (12.3). To run any extension in GEDitCOM II that uses Python since then, you will need to install Python. It is a two step process. First, click that "Install" button when it appears and you try to run a python extension. But that is not enough. If you try again, python will start but then complain of missing "Foundation" module. See GEDitCOM II help to fix that:

     Help Window -> Extensions (in index in left) -> Extensions (link text in topic) -> Python 3.x has replaced Python 2.7 (link to section)

I have always gotten it to work, but it can be tricky. It took me tries in MacOS Sonoma "upgrade'." Once installed, you can run any of the Extensions that use Python.

John Nairn

Nigel Garvey

unread,
Feb 23, 2024, 4:48:20 PMFeb 23
to geditcom-ii...@googlegroups.com


On 23 Feb 2024, at 19:25, John Nairn, Developer <jo...@geditcom.com> wrote:

1. The option to get "Descendants by Generations" in a Pages document is an AppleScript […]

I will test myself using Sonoma 14.3.1 later (computer is not with me now) to see if I have same issue and if I can solve it. I can't test now because MacOS I have now does not have that problem.

Hi.

The script does work in Sonoma 14.3.1, but since it uses "GUI Scripting" to simulate keystrokes, and since it's presumably GEDitCOM II that's running it, you have to grant GEDitCOM II the various permissions that are requested the first time any of the "Report" AppleScripts is run on that computer. GEDitCOM II needs to be able to control System Events and Pages. If you've run the script and refused the permissions, you may be able to retrieve the situation by going to System Preferences->Privacy & Security->Automation. If GEDitCOM II is listed there, click on its disclosure triangle and enable Pages and System Events (assuming their names are revealed). You'll probably have to enter your user password.

NG

Nigel Garvey

unread,
Feb 23, 2024, 4:54:19 PMFeb 23
to geditcom-ii...@googlegroups.com
Just now, I wrote:

> you may be able to retrieve the situation by going to System Preferences->Privacy & Security->Automation.

Sorry. System Preferences is called System Settings now.

NG

John Nairn

unread,
Feb 23, 2024, 4:57:35 PMFeb 23
to geditcom-ii...@googlegroups.com

Thanks Nigel (and Nigel is the expert who provided the option to export a generations report to Pages too).

 

Regards,

John Nairn

 

--
You received this message because you are subscribed to the Google Groups "GEDitCOM II Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geditcom-ii-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geditcom-ii-discussions/60C85CBC-530B-47E6-8807-FB456EE690F8%40btinternet.com.

John Nairn, Developer

unread,
Feb 23, 2024, 9:11:57 PMFeb 23
to GEDitCOM II Discussions
I tested on my Sonoma 14.3.1. Nigel had the answer with one idiosyncrasy.

When I ran the report for Pages for the first time in Sonoma 14.3.1, I got two messages before it would run:

1. “GEDitCOM II” wants access to control “Pages”. Allowing control will provide access to documents and data in “Pages”, and to perform actions within that app.

... I clicked "Allow"

2. “GEDitCOM II” wants access to control “System Events”. Allowing control will provide access to documents and data in “System Events”, and to perform actions within that app.

... I clicked "Allow"

but then it still blocked key strokes. When I tried the report again, however, it worked. So the first try get settings correct but you have to rerun to use those new settings. This was using Pages 13.2.

John Nairn

David

unread,
Feb 24, 2024, 3:55:23 AMFeb 24
to GEDitCOM II Discussions
I am using Pages 13.2 and this thread was something of a last step, for me. I had already gone through setting up without any solution and the issues in this thread use the attached Automation settings. Some time later today I will take a look at the Pages scripting Library/Dictionary.

Additional - Did a lot of Google searching and found a simple fix on StackOverflow, so 'Simple' I missed it!

System Settings > Privacy & Security > Accessibility. 

Remove GEDitCOM II and add it back then Pages 13.2 does the job.

Automation.png

William G. Bates

unread,
Feb 24, 2024, 9:40:40 PMFeb 24
to 'Nigel Garvey' via GEDitCOM II Discussions
Sonoma 14.3.1 is what I have been using since it was published BUT I have still not gotten AdditionalEvents to work properly. The scripteditor peerforms the actions on the script properly, I THINK, but the report does not add the information to Pages document.

WGB

John Nairn, Developer

unread,
Feb 26, 2024, 12:45:55 PMFeb 26
to GEDitCOM II Discussions
It works for me --- here's how. First, the DescendantsGenerations.gplug script doesn't have an "AdditionalEvents" property. Are you looking at the same one discussed here? It does have "extraEvents" so maybe you meant that term. You can add extra events as follows:

1. Open DescendantsGenerations.gplug extension in GEDitCOM Editor (can do by selecting "Descendants by Generations" extension in GEDitCOM II with option key help down).
2. To edit AppleScript for Pages export, expand "Properties" section, click on "other files", and then double click on "Generations_To_Pages5.applescript" Key. The AppleScript file should open in Apple's ScriptEditor.
3. Scroll down a little to find the lines

property extraEvents : {}
-- Example: include burial events with address
-- property extraEvents : {"BURI", "was buried", true}

4. Comment out the first line and uncomment the last to get

--property extraEvents : {}
-- Example: include burial events with address
property extraEvents : {"BURI", "was buried", true}

5. Save the script and try again in GEDitCOM II. You should see burial events (when found) with address in the Pages report.
6. For each additional event you want, add three more items to extra events such as

property extraEvents : {"BURI", "was buried", true,"BAPM","was baptized",false}

The first of each block of three is GEDCOM tag for the event, the second is verb to describe it (e.g. "He was baptized on..."), and the third is true or false to include or omit an address for the event (if it has an address). All three are required for each extra event.

The script to output a report to a GEDitCOM II window instead of to Pages is now a separate script and the old AppleScript one for that task has been replaced by an internal script that is faster and more reliable. To add extra events to that script:

1. In the opened extension, expand the "Scripts" section and click on "DescendantGenerations.gcscpt" to edit it on the right
2. Click in script edit window and use Find command to find "extraEvents"
3. The comments there explain how to add extra events. To repeat the two extra events mentioned above, insert these lines

CreateList oneEvent,"BURI","was buried","true"
extraEvents.addObject oneEvent
CreateList oneEvent,"BAPM","was baptized","false"
extraEvents.addObject oneEvent

Each extra events adds a 3 element list (all elements required) to the master extraEvents list.

Regards,
John Nairn





William G. Bates

unread,
Feb 26, 2024, 4:06:20 PMFeb 26
to 'Nigel Garvey' via GEDitCOM II Discussions
That did it:

2. To edit AppleScript for Pages export, expand "Properties" section, click on "other files", and then double click on "Generations_To_Pages5.applescript" Key. The AppleScript file should open in Apple's ScriptEditor.

This is what I was missing as it is different than what I used before, I THINK!.

Tks from the octogenerian
Reply all
Reply to author
Forward
0 new messages