Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > alt.comp.lang.applescript > #49 > unrolled thread
| Started by | Chris Schram <chrispam1@me.com> |
|---|---|
| First post | 2018-05-11 21:04 +0000 |
| Last post | 2018-05-11 22:50 +0000 |
| Articles | 3 — 2 participants |
Back to article view | Back to alt.comp.lang.applescript
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
| From | Chris Schram <chrispam1@me.com> |
|---|---|
| Date | 2018-05-11 21:04 +0000 |
| Subject | AppleScripting Numbers |
| Message-ID | <pd50gm$1355$1@gioia.aioe.org> |
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.
--
chrispam1@me.com is a filtered spam magnet. Email replies may be lost.
You're better off replying to this newsgroup.
[toc] | [next] | [standalone]
| From | Jolly Roger <jollyroger@pobox.com> |
|---|---|
| Date | 2018-05-11 22:07 +0000 |
| Message-ID | <flmihiFckt0U1@mid.individual.net> |
| In reply to | #49 |
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
[toc] | [prev] | [next] | [standalone]
| From | Chris Schram <chrispam1@me.com> |
|---|---|
| Date | 2018-05-11 22:50 +0000 |
| Message-ID | <pd56nh$1c85$1@gioia.aioe.org> |
| In reply to | #50 |
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.
[toc] | [prev] | [standalone]
Back to top | Article view | alt.comp.lang.applescript
csiph-web