Le 19 déc. 2009 à 18:41, Paul Berkowitz a écrit : But that's the issue: if you can think of some example that uses a literal number as a formula parameter, do you use a period or a comma for it within the quoted formula in AppleScript?
I forgot to respond to this question.
If I must pass a number in a formula I don't insert it directly.
Example:
If I need to build a formula like this one :
= 12.34 * 56.78
On a French system it must be
=12,34 * 56,78
To build a script behaving correctly on every setting
I build the formula:
"="& (12.34 as text)&"*"&(56.78 as text)
So, Numbers will receive the correct formula.
It works flawlessly, even with the setting used by Carlos Ysunza : a Spanish system (with decimal comma) and Numbers used in English. You may be surprised but in such a setting, Numbers use the English vocabulary but it use the decimal comma. It's the same when I use Numbers in English on my French system.
From my point of view, we have here a perfect design. What is wrong is: (1) the localization of several functions name (2) the treatment of dates (3) the treatment of the localized GUI items. I built a script able to return the localized iWork's components menu item names. It's an awful task because, as far as I know, there is no tool able to extract correctly these localized strings. I was forced to build what I ask Apple to do: a set of resources containing these localized strings. Chris Page wrote here about that: A workaround might be to use the available command-line tools to harvest localized strings from the nibs and place them in *.strings files in your script bundle. This ties the script to a particular version of the target application, but could be updated automatically if you wrote a script to do it.
I always wait for infos about the way to "update automatically". I know that I am not the only one which tried to do that but we got no result. So, if Chris Page is able to post a sample code I will be glad to study it.
Yvan KOENIG (VALLAURIS, France) samedi 19 décembre 2009 20:35:47
|