Mavericks : Numbers Dictionary not found

Hi all,

I have a Numbers Applescript that stopped working after Mavericks install. Thinking it might be iCloud, I tried to Open Dictionary. Numbers was dimmed in the list of Applications when trying to open its Dictionary.

I’m getting the usual missing properties such as this snippet shows:

set «class NMTs» to «class NmCR» (RangeStart & ":" & RangeEnd)
			get «class NMTs»

Is there anything new in Mavericks that I need to set to fix this? Thanks

Model: Mac mini
Browser: Safari 7
Operating System: Mac OS X (10.8)

I’m sorry, but you might want to check this out:

http://fireballed.org/linked/2013/10/23/iwork-applescript/

Thank you for that note. Fortunately I still have Numbers 09 in an archive.

I painstakingly converted my script from Excel to Numbers just so I could run it in Snow Leopard. Apple’s ripping scripting support out of their apps is just unreal.

Don’t just complain here: go to bug report.apple.com and let Apple know.

My understanding is that Apple applied a classic scheme :
the application was rebuilt from scratch (dropping a lot of features) so it has no AppleScript support.
If my memory is OK it was the same when Final Cut was replaced by Final Cut Pro X.
When then delivered an enhanced version, AppleScript support was back.

With Pages we are not fully abandonned. There is a small Ascript support.

This is why I guess that we just need to be patient ” maybe for one year.

Yvan KOENIG (VALLAURIS, France) vendredi 25 octobre 2013 09:30:59

PS : the forum doesn’t allow us to answer 10.9 at the question Ã¥ which Operating System] :rolleyes:

Optimist!
This looks more like the start of Apple abandoning Applescript.
If they don’t even support it in their own Apps, what incentive is there for third parties to support it anymore?

Odd that they actually added some improvements to the language at the same time as they cut back on its utility:
http://www.macstories.net/stories/applescript-automator-and-automation-improvements-in-mavericks/, but Apple’s a big company, they likely don’t have an overall strategy, or at least can’t enforce company-wide uniformity on scripting.

More like “Experienced Optimist.” For those that have been using AppleScript for a number of years, this is frustrating, but not a harbinger of death. So far, all of my iTunes, Mail, and iPhoto scripts continue to operate as originally designed, and this whole Pages/Numbers issue will eventually pass.

My opinion is that they are spending more time preparing to roll out the web-based versions of these applications than they are on the automation capabilities. Time will tell.

It depends what you mean by “improvements”, of course. The ability to invent your own terminology that no-one else will understand when you ask for help debugging your scripts is not a particularly bright idea. Nor is the ability to use terminology ” known or unknown ” without explicit, in-line reference to the application or library providing it. As in the past, good scripters will need to comment non-vanilla terms which aren’t in ‘tell’ statements to explain where they come from, so there’s no advantage to not using ‘tell’ anyway as far as typing or screen estate are concerned. It probably makes no difference at all performancewise.

The easier access to ASObjC features, though, is a definite plus point.

The business with the iWork applications matters because they’re not free. If you’ve paid good money for them and use them daily in situations which rely on the scripts you’ve written for them, the removal of their scriptability without warning or explanation is simply outrageous and being “patient ” maybe for one year” isn’t an option.

The only place you can add terminology is in a call to a library, where it replaces an otherwise opaque handler call. In either case, without the library, you’re going to be guessing. And if you have the library that someone has taken the trouble to add an .sdef to, there’s a fair chance that it contains a lot more information and documentation than the average handler. If it’s a run-only library, the documentation on any handlers is, by definition, invisible to the user.

And adding terminology is not something that has to be done, or, I suspect, will often be done. But IMO it’s great that if someone wants to, say, wrap a framework in some ASObjC code and give it a dictionary, someone who knows nothing about ASObjC or frameworks can open its dictionary in a script editor and use it just like an app or scripting addition. How else do you envisage deploying run-only libraries? With read-me files, the loss of which would effectively make them useless?

It strikes me as an eminently logical consequence of having libraries.

You mean the way scripting addition terminology has been resolved for 20 years?

Unlike in the past, if they use non-vanilla terms within tell blocks scripters good and bad will have to target them, not just comment them.

I disagree, but I’m not sure typing or screen real estate are priorities anyway.

My initial reaction was similar to yours, but I’ve changed my mind. Yes, it makes some things a bit harder to follow. But it also solves the issue of using script addition commands, and it points out terminology conflicts rather than brushing them under the carpet like before. And you’re free to use tells as much as you like. I don’t see it as something to get excited about, but I suspect a lot of the inevitable complaints will be more a reluctance to change.

Don’t forget osaxen! Or better yet, do forget them, other than remembering that they were a pain to write, and that the people who wanted to use your script which used an OSAX never had the right one installed, and even if they did, the next System update broke it.
This Library thing seems like it could be slightly more robust, especially if someone builds a little library handling Application to serve as a front end.

Hello.

There are more advantages of cooperating in developing libraries, now than having everybody reinvent the wheel, it has to start now, if it is ever to start, or it will be like it allways have been, at least for as long as I have used Applescript, where everybody has their own blog/library, so that you have to trawl the net to find what your look for.

I am a very lazy person, so I prefer to have it all in one place, and what would be more natural than having it all under the roof of MacScripters?

Now if we had a site, with mercurial, or git support, that the community agreed upon to use, where for instance Ray Barber is admin. Cunning people, could then decide upon general guidelines, and we all could pull libraries and push, back changes, via modern free tools like MacHG for intstance. (I love Mercurial.) It is crucial, that each library would have their own moderator, that accepts, tests, and eventually declines patches/changes.

Somebody would have to create a standard with regards to documentation too, and what kind of documentation is needed, for a patch change to be accepted. I am not saying that the whole rigourousness of the Linux kernel is needed, but that some standards and conventions, must be applied for it all to work out well.

If we could make something like this to happen, before all are sitting on their own hills, protecting “their own” code, we could certainly have a very good thing going. :slight_smile:

Installing the new version didn’t deleted the old one.

We are free to move the new apps in a disk image to enforce it to remain asleep, delete the versions available in the Applications folder and work with the old ones.
It’s what I did.
I just discovered that some details behave differently with Numbers '09 under 10.8.x and Numbers '09 unde 10.9.
I made a large use of the function DECALER (OFFSET in English).
Under 10.6, 10.7 and 10.8, I was able to use :

=DECALER(K13;-1;0)+SI(NBCAR(H13)>0;-H13;0)+SI(NBCAR(I13)>0;I13;0)
If I made no translation error, in English it would be :
=OFFSET(K13,-1,0)+IF(LEN(H13)>0,-H13,0)+IF(LEN(I13)>0,I13,0)
with the formula in the cell K13.
DECALER is the unique function which accepted a reference to the hosting cell.

Under 10.9, some cells containing such formula issue the infamous red arrow flagging an error.
As only some cells do that, I applied Fill down upon them and got working formulas but the red arrow reappear at next opening.
This is why I decided to edit the formula as :
=DECALER(F13;-1;5)+SI(NBCAR(H13)>0;-H13;0)+SI(NBCAR(I13)>0;I13;0)
Again if I made no translation error, in English it would be :
=OFFSET(F13,-1,5)+IF(LEN(H13)>0,-H13,0)+IF(LEN(I13)>0,I13,0)
And this time it behaves flawlessly in the four operating systems.

At this time it’s the unique drawback which I got with the described installation.

I started the edition of my scripts to force them to apply upon iWork '09 applications even when the iPlay '13 applications are available which is the case when I have both apps open simultaneously to write an article comparing them point by point.

Yvan KOENIG (VALLAURIS, France) lundi 28 octobre 2013 21:39:03

Ah. Thanks Yvan. I was going to e-mail you to ask if that was the case. I’d been confused reading the various reports, but now I think I understand: the old iWork '09 versions of Numbers, Pages, and Keynote are as scriptable in Mavericks as they were before, but the new, unscriptable versions have to be removed first so that script events aren’t sent to them instead. Good! :slight_smile:

Your English version is absolutely correct and specifies that the value in K13 should be the value in the cell immediately above + minus the value in H13 if there is one + the value in I13 ditto. I didn’t realise it was possible for formulae to be in different languages. How cool! :slight_smile:

Specifying the cell immediately above as the cell in the row above which is five columns to the right of the column five to the left. Bizarre … :confused:

Nothing bizarre.
Some formulas aren’t robust enough to support a sort.
Using OFFSET as I do is a way to have a robust formula.
The original formula is easy to understand as you described it
The new one does exactly the same thing : get the value just above the cell where ii is inserted.
The difference is that it no longer embed a reference to the hosting cell which the original one did.

Honestly I don’t know what is wrong.

Was it the original one which benefit of a hole in syntax checking ” there is a defined error message flagging formulas embedding a reference to the hosting cell
or
Is it a change in the system which forbid now what was accepted ?

I’m really surprised to see that a change in the system modify the behavior of the syntax checker but I have no mean to find an explanation so I just edit my formulas to match the new rule.
Using the cell five columns to the left of the hosting cell as origin for coordinates used by OFFSET is purely an arbitrary choice.
I refused to use the cell just on the left because it grab the value of the hosting cell.
Maybe I will edit again and use the cell in column 1 but I’m wondering if it’s really a good idea.
I may have to insert new columns between the column A and the column F while I’m sure that there will always be the offset 5 between the column which are F and K at this time so the “surprising” choice is more robust than the alternate “logical” one.

I’m quite at ease whith that because as an engineer I am accustomed to change the origin according to the needs.
When I defined the location of an electric switch in a room at the 14th floor, I didn’t calculated it starting from the ground level :confused:

In France we are using a boundary-stone near the cathedral “Notre dame de Paris” as the origin for distances carved on milestones.
But when a contractor build an house in an estate, he is not fool enough to measure starting from Paris :confused:

I’m always surprised when I read that English users are surprised by the fact that spreadsheet functions names are localised. They were in AppleWorks, they are in Excel, in openOffice, in libreOffice, in iWork and now in iPlay.
It’s the same for the decimal delimiter, for the delimier used in spreadsheet formulas and for the delimiter used in CSV files.

If you look in the posted formulas, you will see that the used delimiter is semi-colon while English formulas use the comma.
This is why, in several of my scripts, I use these handlers to build non localization dependant scripts:

#=====
(*
Set the parameter delimiters which must be used in Numbers formulas
set {delim, deci} to my get2LocalizedDelimiters()
*)
on get2LocalizedDelimiters()
	if character 2 of (0.5 as text) is "." then
		return {",", "."}
	else
		return {";", ","}
	end if
end get2LocalizedDelimiters

#=====
(*
Useful to get function's localized name if we need to build formulas
examples:
set OFFSET_loc to my getLocalizedTabularString("Numbers", "OFFSET")
set ADDRESS_loc to my getLocalizedTabularString("Numbers", "ADDRESS")
set INDIRECT_loc to my getLocalizedTabularString("Numbers", "INDIRECT")
set Unnamed_Table_loc to my getLocalizedTabularString("Numbers", "Unnamed Table")

Requires :
decoupe()
get_iWorkNum()
*)
on getLocalizedTabularString(theApp, x)
	local path2app
	activate application theApp
	tell application "System Events"
		set path2app to path of (get application file of process theApp)
		exists folder (path2app & "Contents:Frameworks:SFTabular.framework")
	end tell
	if result then
		path2app & "Contents:Frameworks:SFTabular.framework:Versions:A:Resources:"
	else
		(path to application support as text) & "iWork '" & my get_iWorkNum(theApp) & ":Frameworks:SFTabular.framework:Versions:A:Resources:"
	end if
	tell application theApp to return localized string x from table "Localizable" in bundle file result
end getLocalizedTabularString

#=====

Maybe learning that will help you why I’m sometimes nervous when I am blamed because I use French varnames.
I never saw an other coder taking care of localization problems in scripts as I do.

Even Bill Cheeseman’s UI Browser is English specific and it’s why I refuse to buy it.
The scripts which it deliver must be heavily edited if we want to take care of non-English users.

On my side, varnames are often french-looking ” and will continue to be ” but when my scripts are supposed to build formulas for Numbers, they deliver ones matching the user’s language settings.
When I post a script using GUIscripting, I do my best to deliver script running correctly on differently localized systems.
Who is doing that except myself?

Yvan KOENIG (VALLAURIS, France) mardi 29 octobre 2013 10:10:41

Yes. I guessed that. Numbers’s “Reorganize” function sorts entire rows or columns, which of course includes any formulae in them. As these formulae are moved around, their relative indexing of other cells take on new meanings. I forget now whether they keep pointing to the original cells or to the cells which have been sorted into the original postions of those cells. (“Reorganize” was one of the first functions I decided never to use.) But OFFSET always refers to cells so many positions removed in a given direction from the given base cell.

With my own Number’s documents, I use scripts to extract, sort (in AppleScript), and replace just the “hard data” ranges. This allows me to sort and subsort on several different columns and means I can just use cell addresses in formulae, since these don’t get sorted. (Also, if you’re interested, where you’ve got (in English) “+IF(LEN(H13)>0,-H13,0)”, I might use something like “+IF(ISBLANK(H13),0,-H13)” ” although in this case I wouldn’t bother, as an empty cell has a notional value of either 0 or “” anyway, so I’d just use “-H13”.)

I don’t see why that should make any difference, although I take your word for it that it does. In the context of OFFSET, the base cell reference means the cell itself, not the value it contains. OFFSET obviously should be able to refer to the host cell, since that’s the most likely cell from which an offset will be required. In the absence of a symbol meaning “this cell”, the cell’s own address has to do. I think your original usage was correct, even if it doesn’t work now. :wink:

There’s usually no reason why English speakers ” or any other speakers ” should ever encounter that fact unless they’re working in a country, or following a forum, which uses a language other than their own.

Not quite the same. Here, your beef is about English-speaking scripters and programmers making parochial assumptions about what’s in text. And with regard to scripts and software released for use worldwide, you’re absolutely right. It’s up to authors to ensure that their work behaves correctly under all local conditions, not just their own.

However, in the case of a single-language scripting-help forum, the case isn’t as clear-cut. People are generally seeking help with single aspects of scripts they’re writing, which may be for general release or may be just for use on their own computers. The focus in such cases should be on helping them solve those particular problems in ways that they can easily see and understand, not on burdening them with irrelevancies or pushing complete scripts at them complete with dialogs, localisations into other languages, or whatever else. If it may be of help to a poster to know that people do things differently in different parts of the world, then by all means point it out, but don’t swamp out the answer to their original query and don’t get upset if the local language’s way of doing things isn’t yours.

No-one’s ever blamed you for using French variable names ” or blamed anyone else for using variable names in their own languages ” although it must be obvious to you that in an English-speaking forum, English-like names give greater clarity to the greater number of readers. Just don’t get prickly if someone asks you for a translation. But we’ve already had this discussion. :slight_smile:

Hello Nigel

At this time I’m spending some times on archives from applescript-users@lists.apple.com.
A lot of threads were created long before I entered the forum.
I found numerous threads in which the asked question was never answered simply because the asker wasn’t running the system in English.
He didn’t understood why the code given by helpers failed and helpers never understood why the code which behaved well on their machines failed on the asker’s one ” most often problem of decimal delimiter.
A quite common problem of this kind is the CSV behaviour. Quite nobody was aware of the fact that a CSV file is not always a Comma Separated Values file but a Semi-colon Separated Values one. In fact it’s why I hate this format.

An other sample is the behaviour of Numbers (I don’t know if Excel behaves the same) when we try to set the value of a cell. For you English users I know that you may use
set value of cell “B5” to 123.5
and I guess that you may use :
set value of cell “C6” to current date

We, non English users must use:
set value of cell “B5” to (123.5 as text)
set value of cell “C6” to (current date as text)
The syntax required for us works for you too.

Yvan KOENIG (VALLAURIS, France) mardi 29 octobre 2013 17:48:08