Constructing a handler to collect infor
Constructing a handler to collect infor
- Subject: Constructing a handler to collect infor
- From: Steven Valenti <email@hidden>
- Date: Wed, 28 Jan 2004 12:43:51 -0500
Hi All,
Although the following script works, I looking for better ways to
construct the codes I have written. Im not a very weathered Apple
scripter and would like to see how others would go about collecting
information. The first three set variables have descended from previous
dialog prompts which we then arrive at the if statement. So our first
model is 200 and now we are adding other models. Products need to be
confirmed that they exist on a server. I disabled this and temporary
put in a say command so others could work with it. Im thinking I want
to use a sub routine or script object since adding a third model is
similar. I need to have access to the variables Product_Model_2,
Product_Model_3, and Multi_List outside of any handlers.
Any Ideas? Questions?
Thanks
set Email_Type to "Multi Models"
set the_Product to "200"
set Model_Catagory to {"LightersRegular"}
if Email_Type is "Multi Models" then
repeat
set Multi to display dialog "Enter the Product Number" default answer
,
"Product Number" buttons {"Need 3rd Model", "Choose 2nd Model"}
default button "Choose 2nd Model"
set Product_2 to text returned of Multi as string
set More_Models to button returned of Multi as string
set Product_Model_2 to ,
"AppleCore:CreativeServices:ImageSource:E-MailMasters:" &
Model_Catagory & ":" & Product_2 ,
& "-EProof.psd" as string
try
-- The following line of code will check if this is a valid Product
--set the_Product_Model_2 to the_Product_Model_2 as alias
say "Model Confirmed"
exit repeat
on error
display dialog Product_2 & ,
" wasn't found in the data base" buttons "Enter New Model" default
button "Enter New Model"
end try
end repeat
set Multi_List to the_Product & ", " & Product_2 -- creates a list of
the products
if More_Models is "Need 3rd Model" then
repeat
set Product_3 to text returned of (display dialog ,
"Enter the Product Number" default answer "Product Number" buttons
{"Choose 3rd Model"} ,
default button "Choose 3rd Model")
set Product_Model_3 to ,
"AppleCore:CreativeServices:ImageSource:E-MailMasters:" &
Model_Catagory & ":" & Product_3 ,
& "-EProof.psd" as string
try
-- The following line of code will check if this is a valid Product
--set the_Product_Model_3 to the_Product_Model_3 as alias
say "Model Confirmed"
exit repeat
on error
display dialog Product_3 & ,
" wasn't found in the data base" buttons "Enter New Model" default
button "Enter New Model"
end try
end repeat
set Multi_List to Multi_List & ", " & Product_3 -- creates a list of
the products
end if
end if
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.