Re: Numbers: 'make new' failing in various ways?
Re: Numbers: 'make new' failing in various ways?
- Subject: Re: Numbers: 'make new' failing in various ways?
- From: email@hidden
- Date: Tue, 31 May 2011 22:09:56 +0000 (GMT)
On May 31, 2011, Michelle Steiner wrote:
>On May 31, 2011, at 9:19 AM, email@hidden wrote:
>>The right thing would be for the new table to appear in sheet "aaa".
>>What I am seeing instead is a new table appearing in sheet "bbb" (which is active, having just been created).
>>AFAICT make new table always puts the table in the active sheet, regardless of tell context.
>
>The right thing for it to do in that script is to put the table in sheet bbb because it is the active sheet and you didn't tell the script to put it anywhere else.
But I *did' tell it to put it somewhere else. I wrote tell s1.
Maybe things have changed while I was away, but I understood (after applescripting for over a decade) that
tell x to make new y
is supposed to make x inside y, not inside whatever happens to be selected in the GUI. That is the right thing, surely.
(This is consistent with Technote 2106 - "script the model, not the view").
For example, if I say tell app "BBEdit" to make new document, without activating BBEdit, and with some other app frontmost, I don't expect the new document to appear in the frontmost app. I expect it to appear in BBEdit. Right? That's the whole point of tell.
Besides, I have not asked for newly created sheet to be selected/activated. It's a side effect which I have no control over.
> What you need is either of these:
> set t to make new table at sheet "bbb" with properties {name:"sss", column count:4, row count:5}
> Or
> set t to make new table at s2 with properties {name:"sss", column count:4, row count:5}
>
>Or
> tell s2 to set t to make new table with properties {name:"sss", column count:4, row count:5}
>However, the first two of those result in this error error "The variable t is not defined." number -2753 from "t"
>In this line:
> return {s1, s2, t}
No! What I want is to make the table inside s1, not s2. That's the whole problem.
A location specifier such as
....at sheet "aaa"...
or
...at s1...
would indeed be logical, but it actually doesn't work either.
It's easy to make the table in s2 because it's the last sheet made, and therefore active in the GUI, so your suggestion is only working by pure accident.
If I alter your scripts to use s1 (or sheet "aaa"), it still makes the table in s2.
This still seems like a bug to me
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden