Groups | Search | Server Info | Login | Register


Groups > alt.comp.lang.applescript > #50

Re: AppleScripting Numbers

From Jolly Roger <jollyroger@pobox.com>
Newsgroups alt.comp.lang.applescript, comp.sys.mac.apps
Subject Re: AppleScripting Numbers
Date 2018-05-11 22:07 +0000
Organization People for the Ethical Treatment of Pirates
Message-ID <flmihiFckt0U1@mid.individual.net> (permalink)
References <pd50gm$1355$1@gioia.aioe.org>

Cross-posted to 2 groups.

Show all headers | View raw


On 2018-05-11, Chris Schram <chrispam1@me.com> wrote:
>
> Sorry for the crosspost, but there have been no messages in
> alt.comp.lang.applescript since last March.
>
> I am working on a Numbers spreadsheet that gets populated with data pasted in
> from a text file. Among that data is a column of dates in the "2018-05-11
> 13:00:00" format. I can ensure that Numbers recognizes them as dates with
> something like:
>
> set selection range to range ("E3:E146")
> set the format of selection range to date and time
>
> But I would like the dates to look more like "Fri, May 11, 2018 1:00 PM". This
> is very easily dome within Numbers; there are numerous date formats available. I
> just can't figure out the incantation within AppleScript that can perform that
> formatting.
>
> Ideas? Thanks.

Looking at the Numbers dictionary (Script Editor > Open Dictionary >
Numbers), it doesn't appear Numbers supports anything but setting the
cell format to "date and time" with AppleScript. 

And looking at Xcode > Open Developer Tool > Accessibility Inspector, it
doesn't appear Numbers assigns labels to the date and time format pop-up
menus; so I'm not sure you'd be able to access them with accessibility
scripting either - though I could be wrong:

<https://developer.apple.com/library/content/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/AutomatetheUserInterface.html>

That leaves "click at {x-coordinate, y-coordinate}" type scripting,
which leaves a *lot* to be desired and will be problematic for obvious
reasons unless you can ensure the window will always be open at the
exact same position and you won't be touching the mouse or keyboard
while the script executes. 

Otherwise, you're stuck manually selecting the column and then applying
the change by clicking the mouse yourself. 

-- 
E-mail sent to this address may be devoured by my ravenous SPAM filter.
I often ignore posts from Google. Use a real news client instead.

JR

Back to alt.comp.lang.applescript | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

AppleScripting Numbers Chris Schram <chrispam1@me.com> - 2018-05-11 21:04 +0000
  Re: AppleScripting Numbers Jolly Roger <jollyroger@pobox.com> - 2018-05-11 22:07 +0000
    Re: AppleScripting Numbers Chris Schram <chrispam1@me.com> - 2018-05-11 22:50 +0000

csiph-web