Dialog Library

Overview | Usage | Sample Code | Version History | User Comments | Download


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



Change the curesor to a busy cursor, using the WCHandy OSAX showBusyCursor() hideBusyCursor() Th ecode will have no effect on a system where the OSAX is not installed.


a notifier can be created The GetNewNotificationType(theType) is used to get a new GetDefaultNotificationType() createGrowlNotifier(appName, notifications, iconAppName) createNotifier(type, appName, notifications, iconAppName) - Post(notification, title, msgs) - type() - longType()

Progress Bars

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
Shows the progress bar window. The second function will make the window appear as if it is fading in.
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)

(* Load the Libraries that need to be used <http://applemods.sourceforge.net/> *)
property _Loader : run application "LoaderServer"
property _Dialog : missing value

on __load__(loader)
set _Dialog to loader's loadLib("PCS_Dialog")
end __load__

on run
__load__(_Loader's makeLoader())

set progress to _Dialog's createProgressBar("My Progress Bar", "Aqua", 10)
tell progress to update(1, "Saving attachments...")
tell progress to autoupdate(2, "Item ", "...")

tell progress to show()

repeat with i from 1 to 15
tell progress to increment()
delay 0.2
end repeat

tell progress to hide()
tell progress to destroy()
end run

Version History

User Comments

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)