Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Jolly Roger Newsgroups: alt.comp.lang.applescript,comp.sys.mac.apps Subject: Re: AppleScripting Numbers Date: 11 May 2018 22:07:46 GMT Organization: People for the Ethical Treatment of Pirates Lines: 45 Message-ID: References: X-Trace: individual.net 4tHl/WF4uSXCoeYlJvvLwQaBF66wDx1ho2KJYyaBnil3iqFkbp Cancel-Lock: sha1:ATDYE3sIvg2BGrSbtxLKbCbtnBk= Mail-Copies-To: nobody X-Face: _.g>n!a$f3/H3jA]>9pN55*5<`}Tud57>1Y%b|b-Y~()~\t,LZ3e up1/bO{=-) User-Agent: slrn/1.0.1 (Darwin) Xref: csiph.com alt.comp.lang.applescript:50 comp.sys.mac.apps:42800 On 2018-05-11, Chris Schram 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: 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