[Ch...] Posted April 20, 2023 Share Posted April 20, 2023 Hi, i would like to make a user aware of report pages wich have to tags assigned. How can i get the page number as in the table of contents using a script? Link to comment Share on other sites More sharing options...
[Na...] Posted May 2, 2023 Share Posted May 2, 2023 Hello, you could add a page counter in a loop: # -*- coding: utf-8 -*- import gom #no_tag = [] pages = gom.app.project.reports page_nr = 0 for i in pages: page_nr = page_nr + 1 try: print('Page ', page_nr, 'has tag ', i.tags[0]) except: print('No tag: page ', page_nr) #no_tag.append (i) Link to comment Share on other sites More sharing options...
[Ju...] Posted February 5 Share Posted February 5 Hi Nanno, this is very usefull but... If a page had multiple pages like : the count is not working... is there any solution to get the "real" page number ? Thank a lot Link to comment Share on other sites More sharing options...
[Ri...] Posted February 13 Share Posted February 13 Just change the for loop to: for i in pages: for j in i.pages: page_nr = page_nr + 1 try: print('Page ', page_nr, 'has tag ', j.tags[0]) except: print('No tag: page ', page_nr) #no_tag.append (j) Link to comment Share on other sites More sharing options...
[At...] Posted February 13 Share Posted February 13 I'm stupid it was so simple ! Thanks a lot for your help Riccardo ! Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in