Re: applescript-users digest, Vol 2 #1059 - 17 msgs
Re: applescript-users digest, Vol 2 #1059 - 17 msgs
- Subject: Re: applescript-users digest, Vol 2 #1059 - 17 msgs
- From: David Simerly <email@hidden>
- Date: Wed, 12 Sep 2001 13:35:33 -0700
- Url: http://www.digital-native.com
on 9/12/01 12:36 PM, Jesper Brandt at <email@hidden> wrote:
>
I need to save some parameters in a applescript, where it saves a number
>
and a number list. The reason is so a AppleScript can access these
>
numbers, and use them as input parameters.
>
>
So the general idea is that you run a script, that asks the input
>
parameters. Then, until you run this first script again, a second script
>
will use these parameters every time it runs.
>
>
Is this possible?
Sure. Here's one way (save both samples below as script applications --
watch for e-mail line breaks -- in the Scripts folder, and then launch
"Enter Default" first):
------ Begin first sample script, "Enter Default"
property default_number : 0
on run
-- prompt user and store entry in a property...
set default_number to text returned of ,
(display dialog "Enter a default number:" default answer
default_number)
end run
------ End first sample script
------ Begin second sample script, "Display Default"
on run
-- load "Enter Default" as a script object
set saved_default to load script ((((path to scripts folder) as text) &
"Enter Default") as alias)
-- access the value of the saved property
set default_number to saved_default's default_number
-- display the value
display dialog "The default number is: " & default_number
end run
------ End second sample script
This method should work for any data type that can be stored in a property.
HTH.
DS
______________________________________
Digital Native
Your guide through the virtual jungle.
______________________________________
"What is a committee? A group of the unwilling, picked from the unfit, to do
the unnecessary." -- Mark Twain