Skip to content

Keynote Application crashes / dies after setting properties on new document #12

Description

@benkfra

Hi there,
it sounds like a very specific problem and I also can't tell if it's not even due to the Keynote app itself.

When I run the sample code below, the keynote app dies about 20 seconds after I set properties of a new document.
With pure AppleScript I could not observe this problem.

Could this have something to do with PyXA or the PyObjC framework used in relation to the garbage collection algorhythm?

# -*- coding: utf-8 -*-

import PyXA
import time

keynote = PyXA.Application('Keynote')
keynote.activate()

newDocumentName = 'Untitled'
wrongDocument = keynote.new_document(newDocumentName)
# If a document was already open, not the newly created document is returned 
# here, but the previously existing document. Keynote seems to re-sort the 
# list with the creation of documents.

newDocument = keynote.documents()[0]
# setting the properties of the newly created document crashes keynote in 
# about 20 seconds...
newDocument.width = 2224
newDocument.height = 1668

time.sleep(20)

# by now, the keynote app should have crashed / died by accident.
# so the next statement should fail...
currentDocument = keynote.documents()[0]

pass

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions