MACSCRPT Archives

April 2006

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Gary (Lists)" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Fri, 21 Apr 2006 19:00:23 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (112 lines)
"Emmanuel" wrote:

> At 4:04 PM -0500 4/20/06, John A.M. Darnell wrote:
>> Sigh, Tiger is not an option at this point.  I'm already looking at
>> Panther.
>> 
>> Thanks everyone!  This looks like a winner!
> 
> Or not. Smile would be probably a much faster solution. I hope a user
> of Smile will second my saying, since I must be biased - I am from
> the company which makes Smile.


You seconded someone, already ;)


"Gary (Lists)" previously wrote:

> But, in case you did not know this, Smile has an easy-to-use built-in GUI
> builder.

So, here's to thirding.


[I'm now convinced that I am added to Emmanuel's spam filter.
 C'est la vie. And "woe is moi".  :(  ]


"John A.M. Darnell" wrote:

Gary wrote: 
>> If you need help, you may find subscribing to the SUL (Smile Users List) a
>> fun and low-volume resource.
>> 
> 
> Can someone direct me to where I can sign up for this list?

Subscribe:
<http://lists.satimage-software.com:20080/mailman/listinfo/sul>

> And as my first SMILE question, on the Control Dialog, there is an edit
> field for something called a "tag" and a check box for "automatic tag."
> What is a tag, and why would I choose to use it?  What does automatic tag
> do for me?

This can be completely ignored for your learning cycle (and beyond.)

Do not worry with checking this item.

> And as my second question, on the examples I looked at I would see
> controls on the dialog referred to as "item X of the dialog."  Can dialog
> items be referred to by name?  If so, what's the syntax?

Yes, they can. Just like any other AS value.

Dialogs have a 'dialog script'.  This script, as you see in the samples, has
a handler called 'on prepare()'.

It is in this handler that you will wish to make your "id -> name"
assignments, shuffling dialog item ids onto named properties.

Here is a real-life sample of such from my 'Smile Commands Palette', which
allows one to type and run AppleScript code directed at other currently open
dialogs (it auto-discovers such open dialogs and allows targeting of their
objects, but that's not relevant. It's just a dev tool.)


Copied and pasted directly from the dialog's main script (which is what you
see when you switch to edit mode (cmd-Y) and then cmd-opt-click on the
dialog's background:


-- Named Dialog Objects

property theDialog : missing value
property oMainTell : missing value
property oSubTell : missing value
property oMainScript : missing value
property oLocalOutput : missing value
property oConsoleOutputFlag : missing value
property oCommandMenu : missing value


on prepare theDialog
    
    copy theDialog to my theDialog
    
    set oMainTell to dialog item 2 of my theDialog
    set oSubTell to dialog item 8 of my theDialog
    set oMainScript to dialog item 5 of my theDialog
    set oLocalOutput to dialog item 6 of my theDialog
    set oConsoleOutputFlag to dialog item 3 of my theDialog
    set oCommandMenu to dialog item 7 of my theDialog
    ...

end prepare

And then later, in other handlers, I can target those objects by name, as
in:

        set the menu of oMainTell to allOpenDialogNames


> As soon as I get onto the SUL, I promise I will take my SMILE questions to
> that list.

Excellent.

HTH and HTYLSAMAID
--
Gary

ATOM RSS1 RSS2