Is it fair to say that AppleScript is dead on Apple Pages?

I need to do something really simple. I need to put paragraphs of text into a Pages document using the styles found in the Pages document.

It was very straightforward with the older Pages, but now that Apple has “improved” it (what a joke) it does not seem possible.

Am I wrong here? Is it no longer possible to write an AppleScript script that invoke the “new improved Pages” and inserts certain text in the document and a certain cursor position using a certain style?

Thanks in advance for any input. This is workable with MS Word, but I really don’t want to switch to word.

If we check open-source we can see how every damn application users it’s own favorite scripting language: ruby, python, lua, JavaScript, ect ect

The beauty of applescript is it’s simplicity and availability to all Mac applications, which support scripting. Yes the iWork suite is getting worse, Aperture was dropped too and iTunes will follow soon. I don’t like to upgrade too quickly for many reasons. My work environment is more important than some trendy eye candy crap who limits me in my work.

At this point I’d suggest you to script Textedit and paste these paragraphs back manually to Pages if this makes sense to you.
Another option would be to partition your disk and install 1.11 on the other partition (or whatever Os more suitable to you), which allows you to script what you need to get things done.

OK - thanks.

I am a die hard Mac fan, but I must say I am really having my doubts about Apple since Steve Jobs died. I am sick and tired of them offering something, and then once people buy into it they pull the rug out from under you.

Another example is their Server.

Copying the contents of the document (any) does not require the scriptability of the application that created the document. The text along with the style is copied to clipboard using the Option+Command+C shortcut of keyboard. Then you can retrive information from clipboard to paste at chosen paragraph. I don’t know if this will help solve your problem, since I don’t use Pages myself.

The policy of reducing the possibility of scripting does not like anyone except Apple. But this is a fact and, unfortunately, we have to reckon with it.

Sadly, Pages has been something of a dead duck scriptingwise ever since version 5. It lost most of its scriptability then and its subsequent development’s been aimed at gimmicks like being able to share documents with your friends’ mobile phones, publish your correspondence to Apple Books, record audio, see the tool bar in Dark Mode, etc. — at the expense of basic competence and usefulness.

I bought iWork ’09 some years ago because Pages and Numbers looked to be within one version of being brilliant. (I’ve no use for Keynote.) But both were dumbed down at their next major releases and I’ve been obliged to stick with the iWork ’09 versions ever since. Unfortunately, Pages 4.3 can’t open or create its own documents in Mojave, so I’ve had to switch to later versions on both my Mojave and El Capitan machines. Fortunately, one of the two scripts I use most often still works and the other has only needed a minor adjustment.

I did write a library a while back which allows scripts to create entire texts (no graphics) in a variety of styles and paste them into post-’09 versions of Pages. But I don’t need it myself and have forgotten how to use it now! :rolleyes:

Numbers too is approaching a crunch point for me. I recently adapted my numerous Numbers ’09 scripts to work with later versions too if they found themselves landed with them. However, it turns out that Numbers’s file format’s changed more than once since ’09. Version 3.6.2 (the latest that’ll run on my El Capitan machine) can’t open files created by version 6.0 (the latest for Mojave). The only way to get files that are readable by both versions is to have them both export in ’09 format — so I may as well stick with the ’09 application anyway! However, it’s a 32-bit app and it — along with two others on which I rely every day and aren’t being upgraded to 64-bit — won’t run on future versions of macOS. So I could be sticking with Mojave for a while….

An alternative to investigate for the future might be using Google Sheets, Google Word, etc. and automating content manipulation using the respective Google APIs.

I will certainly not manipulate personal datas in a Google application !

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) mercredi 24 avril 2019 16:15:28

For me, version 4.1 is the last one that will run my scripts. I think that the next version was the first that wouldn’t allow me to address text boxes by name.

What I do is keep version 4.1 on my mac and use that, and only use the latest version when I have to. (Which isn’t very often).

There is very little conflict between versions. Eventually I’m sure that version will become incompatible with the latest MacOS, of course.


Thanks for the assistance.

One more thing.

Can someone tell me the latest version number of Xcode that supports AppleScriptObjC?

Thanks again.

The current version does (10.2), and there’s no reason to think support will disappear any time soon.

If you just want to paste in some paragraphs and the ‘styles’ you need mainly just need a specific font, size and color, you can still sorta get there with Pages. But yeah, you don’t seem able to apply a style. Still plenty of automation you can accomplish. Feature request to Apple?