Mailing Lists: Apple Mailing Lists

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

Keep doing this while this is...



Hi all,

A while back I was generously helped on Apple's AS Discussion board through the process of coming up with an 'elapsed time' timer for a project. Here it is again, in it's context, this being the main routine:

set currentCount to "0"
set totalCount to (count of listOfSelectedTracks)
tell progress indicator "progBar" of box "box_prog" of window "p_prog"
set indeterminate to false
set minimum value to currentCount
set maximum value to totalCount
set contents to 0
end tell
set startTime to current date
repeat with i from 1 to totalCount
set endTime to current date
set theSecs to endTime - startTime
set theSecs to (theSecs as integer)
set theHours to text -2 thru -1 of ("0" & ((theSecs div hours) as text))
set theMinutes to text -2 thru -1 of ("0" & (((theSecs mod hours) div minutes) as text))
set theSeconds to text -2 thru -1 of ("0" & ((theSecs mod minutes) as text))
set content of text field "f_time" of box "box_prog" of window "p_prog" to (theHours & ":" & theMinutes & ":" & theSeconds)
if userCancelled is true then
exit repeat
end if
set currentCount to currentCount + 1
if currentCount b $ totalCount then
tell box "box_prog" of window "p_prog"
tell progress indicator "progBar" to increment by 1
set contents of text field "f_progStatus" to B,
(localized string "PROG_TRACK" from table "Localized") & currentCount & (localized string "PROG_OF" from table "Localized") & totalCount
end tell
set theResult to -1
set theResult to my setFormat(item i of listOfSelectedTracks) -- call sub-routine
end if
end repeat -- finished processing the tracks so...

The problem I'm now facing, is that in the "setFormat" sub-routine, a number of other routines are called (some with repeat loops waiting for user input, and some with SOAP calls), and the timer just 'sticks' until those routines are done with.

Now... is there any way to fix this so that the timer doesn't 'stick'? Is it possible to move the elapsed timer code to a seperate script... can an application run 2 scripts at the same time?

Any help and pointers much appreciated!

Guy
--
autoMAC-it
mailto:email@hidden
visit: http://www.dizzypenguin.com/automac-it/
_______________________________________________
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.



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.