Tuesday, July 14, 2020

#1 2002-12-11 11:28:04 pm

Trash Man
Sanitation Department
Registered: 2005-10-20
Posts: 5336

List property; Cursor look

Greetings.
Writing my first script(s) (for Appleworks); I have two questions. I need to read data into a "list" property; is there any way to define a list without pre-determining the number of elements? What I have now:
property theList : {"", "", "", "", etc.}
repeat Constant times
                set item i of theList to textField i
                set i to i + 1
end repeat
where Constant is set in the code to match the number of elements. I would like to define a property as a list but not define the number of elements (which would be added as each new textField datum is read in).

Second, is there any way to control the look or "type" of the cursor when getting user input? E.g.
set myfilename to choose file with prompt "Choose a File"
the cursor is the watch or the pie rather than an arrow (which is annoying for navigating through the file hierarchy).


One mans trash is another mans treasure

Offline

 

#2 2002-12-12 08:49:16 am

Rob
Member
From:: Ohio, USA
Registered: 2002-11-20
Posts: 1886

Re: List property; Cursor look

Greetings.
Writing my first script(s) (for Appleworks); I have two questions. I need to read data into a "list" property; is there any way to define a list without pre-determining the number of elements?

where Constant is set in the code to match the number of elements. I would like to define a property as a list but not define the number of elements (which would be added as each new textField datum is read in).



Here's an example of repeating based on an unknown number of items. It will add each item to the end of a list. After you run the script, you should have 2 lists that are identical.

Applescript:

property theList : {}
set textFields to {"Joe", "Blow", "1234 Rough Rd.", "His Town", "His State"}

repeat with thisField in textFields
   set theList to (theList & thisField)
end repeat

I have nothing to offer regarding question #2.

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)