Friday, September 20, 2019

#1 2019-04-23 09:50:43 am

Boberino
Member
From:: San Diego, California
Registered: 2008-04-05
Posts: 47
Website

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.


Filed under: Pages Scripts

Offline

 

#2 2019-04-23 11:14:13 am

Joy
Member
From:: South Tirol
Registered: 2008-07-04
Posts: 608
Website

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

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.

Offline

 

#3 2019-04-23 12:03:06 pm

Boberino
Member
From:: San Diego, California
Registered: 2008-04-05
Posts: 47
Website

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

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.

Offline

 

#4 2019-04-23 11:45:32 pm

KniazidisR
Member
Registered: 2019-03-03
Posts: 544

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

Boberino wrote:

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.



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.

Last edited by KniazidisR (2019-04-23 11:46:16 pm)


macOS Mojave -- version 10.14.4
Safari -- version 12.1

Offline

 

#5 2019-04-24 02:38:31 am

Nigel Garvey
Moderator
From:: Warwickshire, England
Registered: 2002-11-20
Posts: 5009

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

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!  roll

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….


NG

Offline

 

#6 2019-04-24 07:19:29 am

CK
Member
From:: UK
Registered: 2018-11-04
Posts: 97

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

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

Offline

 

#7 2019-04-24 08:15:39 am

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 3577

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

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

Offline

 

#8 2019-04-24 10:25:49 am

esla
Member
Registered: 2007-12-29
Posts: 1

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

Nigel Garvey wrote:

Sadly, Pages has been something of a dead duck scriptingwise ever since version 5.




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.

Ed

Offline

 

#9 2019-04-25 11:59:33 am

Boberino
Member
From:: San Diego, California
Registered: 2008-04-05
Posts: 47
Website

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

Thanks for the assistance.

One more thing.

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

Thanks again.

Last edited by Boberino (2019-04-25 12:00:17 pm)


Filed under: AppleScriptObjC

Offline

 

#10 2019-04-25 05:18:54 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5898

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

Boberino wrote:

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



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


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com

Offline

 

#11 2019-04-27 11:31:07 am

vince
Member
Registered: 2002-12-14
Posts: 63

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

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?

https://iworkautomation.com/pages/index.html


vince angeloni

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)