• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Select next bookmark in a Pages doc
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Select next bookmark in a Pages doc


  • Subject: Re: Select next bookmark in a Pages doc
  • From: Christopher Stone <email@hidden>
  • Date: Sat, 6 May 2017 00:08:03 -0500

From: Robert Poland on Mon, 1 May 2017 15:35:57 -0600
I'm looking for a way to select the next bookmark in a Pages Doc.


Hey Bob,

This is one of the many reasons I don't use Pages.  If it was nicer to use and didn't have these sorts of feature-failure hangups I would probably use it, but alas...

Here's a basic UI-Script for doing what you want.

It should select the first bookmark if none are selected and then select each subsequent one through to the end.  It does NOT roll-over back to the first one, although that could be done.

--
Take Care,
Chris

------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2017/05/05 23:25
# dMod: 2017/05/05 23:39
# Appl: Pages
# Task: Go to next bookmark (first bookmark if none are selected).
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Pages, @System_Events, @Go-To, @Next, @Bookmark, @first, @None, @Selected
------------------------------------------------------------------------------

tell application "System Events"
    tell application process "Pages"
        tell (first window whose subrole is "AXStandardWindow")
            
            tell toolbar 1
                tell radio group 1
                    tell radio button "Document"
                        if its value ≠ 1 then
                            click
                        end if
                    end tell
                end tell
            end tell
            
            tell splitter group 1
                tell radio group 1
                    tell radio button "Bookmarks"
                        if its value ≠ 1 then
                            click
                        end if
                    end tell
                end tell
                
                tell scroll area 2
                    tell table 1
                        set focused to true
                        set selRows to rows whose selected is true
                        if selRows = {} then
                            select row 1
                        else
                            try
                                set selRowIndex to value of attribute "AXIndex" of (first row whose selected is true)
                                select row (selRowIndex + 1 + 1)
                            end try
                        end if
                    end tell
                end tell
                
            end tell
            
        end tell
    end tell
end tell

------------------------------------------------------------------------------

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Select next bookmark in a Pages doc
      • From: Robert Poland <email@hidden>
  • Prev by Date: [ANN] Alchemist v1 released
  • Next by Date: Saving reference movie in QuickTime 7 Pro. What descriptors should I use?
  • Previous by thread: Select next bookmark in a Pages doc
  • Next by thread: Re: Select next bookmark in a Pages doc
  • Index(es):
    • Date
    • Thread