Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


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

Re: AppleScripting Numbers

From Chris Schram <chrispam1@me.com>
Newsgroups alt.comp.lang.applescript, comp.sys.mac.apps
Subject Re: AppleScripting Numbers
Date 2018-05-11 22:50 +0000
Organization Where the hell is Langlois, Oregon?
Message-ID <pd56nh$1c85$1@gioia.aioe.org> (permalink)
References <pd50gm$1355$1@gioia.aioe.org> <flmihiFckt0U1@mid.individual.net>

Cross-posted to 2 groups.

Show all headers | View raw


On 2018-05-11, Jolly Roger <jollyroger@pobox.com> wrote:
> 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. 
>

Thanks JR. I was "sort of" able to get what I wanted with the "Watch Me
Do" feature of Automator. For some reason, it couldn't change the date,
but COULD get the time into AM/PM format. Before I give up completely,
I'll fire up UI Browser. But it's a real bitch scripting popups un that
environment.

-- 
chrispam1@me.com is a filtered spam magnet. Email replies may be lost.
You're better off replying to this newsgroup.

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


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