Re: Changing properties?
Re: Changing properties?
- Subject: Re: Changing properties?
- From: "Marc K. Myers" <email@hidden>
- Date: Tue, 03 Jul 2001 10:48:43 -0400
- Organization: [very little]
>
Date: Mon, 2 Jul 2001 16:26:48 -0700
>
From: Christopher Nebel <email@hidden>
>
To: AppleScript Users <email@hidden>
>
Subject: Re: Changing properties?
>
>
On Friday, June 29, 2001, at 12:03 PM, Kreme-LS wrote:
>
>
> I suspect this is a very stupid question, but I have a script that has
>
> two
>
> properties that are set on the script's first run. One is an integer,
>
> the
>
> other is the name of a mailbox (this is a script for Eudora).
>
>
>
> However, I would like the user to be able to change the property. How
>
> do you
>
> tell an applescript to reset the properties?
>
>
I can think of three ways (of varying levels of stupidity) to interpret
>
your question. The really simple one is "how do you set a property?"
>
The answer is "just like you do a variable." For instance:
[Snip!]
>
A third way, as Marc Myers pointed out, is to ask only if the user
>
holds a particular key down when they run the applet. This makes it
>
very easy to use if you just want the default settings; the problem is
>
that you need a custom scripting addition, and if the user forgets the
>
magic key, they're screwed.
>
A fourth way is to break the script into two scripts: one holds the
>
properties and will let you change them if you run it; the other loads
>
the properties from the first and does the actual work. The down side
>
is that you now have two commands instead of one, but both are easy to
>
discover and use.
That's a good idea and eliminates the need for the non-standard osax.
Of course, now you need to remember that there's a separate "setter"
script and where to find it! Using the osax method, it helps to put
reminders about the "magic" key in file comments, script comments, and
the README file.
I think a slight variation on the "fourth way" might be better: The main
script would contain the properties and do all the actual work. When
the properties are not set, it would ask the user to set them. The
"setter" script would access a handler in the main script to reset the
properties to null strings. That way, misplacing the setter script
wouldn't disable the main script.
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com"
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[7/3/01 10:46:10 AM]