Hi Tim !  (Greetings from Denmark :-)

On Windows 8.1 64 bit and QGIS 3.8.1 64 bit:

I've modified your python code a little bit:

from qgis.core import QgsProject
from qgis.utils import iface

def openProject():
    layers = QgsProject.instance().mapLayersByName('kommune')
    layer = layers[0]
    iface.showAttributeTable(layer)


def saveProject():
    pass

def closeProject():
    pass

It works after enabling macro's. (You'll have to change the layer name back to your original layer name)

--
Med venlig hilsen / Kind regards

Bo Victor Thomsen



Den 14-08-2019 kl. 17:21 skrev Tim Sutton:
Hi

Oh thanks for the feedback!

Regards

Tim

On 14 Aug 2019, at 13:27, Mario Baranzini <[email protected] <mailto:[email protected]>> wrote:

Hi Tim,
I have exactly the same error with QGIS 3.8.0 on Archlinux.

Cheers

On Wed, 14 Aug 2019 at 10:13, Tim Sutton <[email protected] <mailto:[email protected]>> wrote:

    Hi All

    I am running into a bug on macOS using QGIS 3.8 using the project
    load python hook [1] and was curious:

    1) Can anybody replicate this on other operating systems
    2) Does the macro run *after* layers have been loaded in the
    project or before?  Former seems more logical to me but you
    should never assume to much eh? :-)

    Thanks

    Tim



    [1] https://github.com/qgis/QGIS/issues/31235
    —


    <KartozaNewLogoThumbnail.jpg>






    *Tim Sutton*

    *Co-founder:*Kartoza
    *Ex Project chair:*QGIS.org <http://qgis.org/>

    Visit http://kartoza.com <http://kartoza.com/> to find out about
    open source:

    Desktop GIS programming services
    Geospatial web development
    GIS Training
    Consulting Services

    *Skype*: timlinux
    *IRC:*timlinux on #qgis at freenode.net <http://freenode.net/>

    I'd love to connect. Here's my calendar link
    <https://calendly.com/timlinux> to make finding time easy.

    _______________________________________________
    QGIS-Developer mailing list
    [email protected]
    <mailto:[email protected]>
    List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
    Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer



--
Mario Baranzini
[email protected] <mailto:[email protected]>
+41 (0)78 733 01 59 <tel:+41787330159>
http://www.opengis.ch <http://www.opengis.ch/>

—








*Tim Sutton*

*Co-founder:*Kartoza
*Ex Project chair:*QGIS.org <http://QGIS.org>

Visit http://kartoza.com <http://kartoza.com/> to find out about open source:

Desktop GIS programming services
Geospatial web development
GIS Training
Consulting Services

*Skype*: timlinux
*IRC:*timlinux on #qgis at freenode.net <http://freenode.net>

I'd love to connect. Here's my calendar link <https://calendly.com/timlinux> to make finding time easy.


_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to