Plaid Cow Solutions’ AppleScripts |
plaidcow.net • applescript • moo! • triangle • writings |
To install the Dialog Library, copy the PCS_Dialog directory into ~/Library/Scripts/ASLibraries/ (or to /Library/Scripts/ASLibraries/ if you want to install it for all users).
The application ProgBar can be used with this interface. To create a progress bar, call the createProgressBar function:
set pb to dialogLibrary's createProgressBar(windowTitle, windowType, theMaxCount)
Where pb is the new progress bar object, windowTitle is the name of the window that will appear in the title bar, windowType is one of { “Aqua”, “Brushed Metal”, “Square Brushed Metal”, “Miniature” }, and maxCount is the final number you are counting to on a defined progress bar. (If maxCount is set to 0 or less, the progress bar will show indeterminate.)
Once you have the progress bar object you can tell it to do the functions that you wish:
Object Function | Purpose |
---|---|
show() showWithFade() |
Shows the progress bar window. The second function will make the window appear as if it is fading in. |
hide() hideWithFade() |
Hide the progress bar window. The second function will make the window appear as if it is fading out. |
increment() | Bump the progress counter by one. Once the count has exceed maxCount (which was passed in) the progress bar will show indeterminate (the barber pole). |
update( line, message ) | Change either the top line or bottom line status which is printed in the progress bar to message. If line is 1, the top line is changed, If line is 2, the bottom line is changed. |
autoupdate( line, pre, post ) | Set either the top line (set line to 1) or bottom line (set line to 2) to autoupdate whenever the increment() function is called. The line will read: “[pre] [theCount] of [maxCount] [post]”. (It really makes a lot of sense when you see it.) |
destroy() | Reset the progress and quit the ProgBar application. |
Sample code: (Edit)
No user comments are available yet. You can make a comment on this script and I will add it here.
Files are not yet available for download. You can make a request via email.
All pages, images and downloads are ©2002-2004 by Randall Million and Plaid Cow Solutions
and subject to the Terms and Conditions of the Plaid Cow Solutions Software License (PCSSL)