Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Optimizing getting contents of text fields



Ok, I've realized I can set the tags for all text fields excluding the labels and then
get the contents of every text field whose tag > 0
and then parse the data. Is there anyway to change the order in which the text field contents are added to the resulting string? I'm guessing they are in the order the fields were created.
Thanks,
Joe

On Dec 16, 2003, at 2:59 AM, Joseph Weaks wrote:

I have this code in a "on write to file" handler in a document app. It cycles through a list statTextKeys and gets the contents of the field with the associated name. I'm creating a keyList and a valueList for use in a call method "dictionaryWithObjects:forKeys:"
With 90 items in the list statTextKeys, this tell block takes approximately 13 seconds.

Any suggestions on how to make this code quicker? All in all, I'm grabbing over 200 values from fields in the document window and it's taking a LONG time for a document to save.

tell tab view item "stats"
set keyList to keyList & statTextKeys
repeat with thisKey in items in statTextKeys
set end of valueList to ((contents of text field (thisKey as string)) as string)
end repeat
end tell

Thanks for any suggestions,
Joe Weaks
_______________________________________________
applescript-studio mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-studio
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Getting the operator's short date under Panther. (From: Paul Berkowitz <email@hidden>)
 >Optimizing getting contents of text fields (From: Joseph Weaks <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.