Re: Open for Access Nightmare
Re: Open for Access Nightmare
- Subject: Re: Open for Access Nightmare
- From: Paul Skinner <email@hidden>
- Date: Wed, 12 Dec 2001 10:44:02 -0500
On Wednesday, December 12, 2001, at 09:30 AM, Robbie Newton wrote:
Hello all,
I have a rather old AS book that I am using as a reference and it talks
about a program called Progress Bar 1.0.1. I got it working but it is a
very
old system looking progress bar. Is there an addition out there that
uses
the MacOS progress bar, or just a more recent version of that progress
bar
app or another?
Also ... When I use that app... You update the progress bar in a repeat
loop. Ok, go that no prob. But how do I keep the script from switching
from
the script and the progress bar ever time the progress bar is updated??
It makes a very undesirable flashing blinking effect on screen as the
switching takes place.
Thanks for any help,
-Robbie
Dialog Director can do this, but if you like the ProgressBar app
then try this...
I use the following handler to create, update and destroy the progress
bar.
repeat with curValue from 1 to 100
ProgressBar({maxValue:100, curValue:curValue, minValue:1,
barName:"ProgressBarName", barCaption:"ProgressBarCaption",
barSubCaption:"ProgressBarSubCaption."})
end repeat
on ProgressBar(parameters)
--Example call
--ProgressBar({maxValue:100, curValue:curValue, minValue:1,
barName:"ProgressBarName", barCaption:"ProgressBarCaption",
barSubCaption:"ProgressBarSubCaption."})
--Minimum parameters
--ProgressBar({maxValue:100, curValue:curValue})
----------------------------------------------------------------------------------------------------
try --to get the current value
set curValue to curValue of parameters
set maxValue to maxValue of parameters
on error
tell application "Progress Bar 1.0.1"
quit
end tell
return false
end try
----------------------------------------------------------------------------------------------------
try
set barName to barName of parameters
try
set barCaption to barCaption of parameters
try
set barSubCaption to barSubCaption of parameters
on error
set barSubCaption to "items."
end try
on error
set barCaption to "Currently Processing"
set barSubCaption to "items."
end try
on error
set barName to "Script Progress"
set barCaption to "Currently Processing"
set barSubCaption to "items."
end try
----------------------------------------------------------------------------------------------------
--test for this bar's existence. Otherwise make it.
try
--Advance the progress bar
tell application "Progress Bar 1.0.1"
--activate
set barReference to a reference to progress bar 1 of window barName
tell barReference
set subcaption to ((curValue as text) & " of " &
(maxValue as text) & " " & barSubCaption)
set current value to curValue
end tell
end tell
on error
--Make the necessary window.
try
set maxValue to maxValue of parameters
tell application "Progress Bar 1.0.1"
activate
make new window with properties {Name:barName, Position:{400, 300}}
set barReference to a reference to progress bar 1 of window barName
tell barReference
set minimum value to 1
set current value to curValue
set maximum value to maxValue
set caption to barCaption
set subcaption to barSubCaption
end tell
end tell
on error
return false
end try
end try
----------
if curValue is maxValue then
tell application "Progress Bar 1.0.1"
quit
end tell
end if
----------------------------------------------------------------------------------------------------
end ProgressBar
P.S. This works in Classic as well.
--
Paul Skinner