Hi,
I have a question about the use of the Indeterminate Circular Progress Indicator in Xcode AppleScript Applications, which has baffled me for days.
On the Interface Builder:
- A button
- An Indeterminate Circular Progress Indicator
- A label (next to the Progress Indicator)
The application is very simple: a user clicks the begin button - executing the following function:
on beginBtnClick_(sender)
-- Show User Notification
inProgressNotice's setHidden:0
inProgressSpinner's setHidden:0
inProgressSpinner's startAnimation:me
-- PERFORM THE FUNCTION'S MAIN TASK
-- Hide User Notification
inProgressSpinner's stopAnimation:me
inProgressSpinner's setHidden:1
inProgressNotice's setHidden:1
end beginBtnClick_
How it should run:
- Upon clicking the button to execute the function, the progress indicator and label (both initially hidden) should become visible and start spinning up.
- The main task of this function will be executed (in my case this involves calling functions in another script, nothing too complex - and it works).
- When step 2 completes, the (spinning) progress indicator and the label should stop and hide.
I think we agree that is the basic functionality of any such indicator.
How it behaves instead:
- Upon clicking the button, the main task of this function executes immediately.
- When the function’s main task has completed, it shows the spinning indicator and the label.
- It then stops and hides the indicator and label.
Could somebody clarify what is going on here? I read somewhere that AS does not consider the order of statements in the function but that cannot possibly be right as it wouldn’t make sense.
I don’t want to create a dialog box to inform the user every time that something is happening in the background (that may not be visible to them), so a Circular Progress Indicator is perfect for this.
How can I achieve the desired result here?