Mailing Lists: Apple Mailing Lists

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

Optimizing getting contents of text fields



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>)



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.