SKProgressBar 1.0, a fully scriptable progress bar

Hi Stefan,
Will you now release/post a new version? I checked v1.0.1 you posted at #7 above, but it is still yesterday’s version.
It’s no rush really, because v1.0 is working just fine.
Regards,
Chris

If the message contains “PrBrStMn”, then it’s using the old terminology. It may be just ASE caching it (this is another good reason to use Script Debugger). But whatever, the only place PrBrStMn is used is in the old version.

Try copying the code in Nigel’s message and see what it compiles to.

Ah, I was wondering why you did it :wink:

Did you recompile the script against the new version, making sure the source code in your editor contained all the original keywords?

OK, this is what I just did again:

  • restored my clean test volume from a “virgin” 10.8.2 disk image with my basic configuration and disabled Spotlight;
  • restarted from it and then ejected my main volume to isolate the clean test volume;
  • opened a new blank script and copy/pasted the code from my original script and then saved the new script as a bundle with a new name;
  • navigated to it’s Resources folder and copied the SKProgressBar.app v1.0.1 to it;
  • compiled and saved it; (no app v1.0 or a script containing it, were in sight or ever run on that clean volume)
  • run it.
    It crashed again at the same place, with the same raw codes but, slightly changed script replies:
tell application "SKProgressBar"
	tell progress bar
		activate
		set indeterminate to false
		«event PrBrStMn»
		tell current application
			-- do shell script ...
		end tell
		repeat 10 times
			«event PrBrIcRm» given «class bYVl»:10.0
			delay 1
		end repeat
		«event PrBrSpMn»
	end tell
	quit --> error number 0
end tell
(*Replies
tell application "SKProgressBar"
	activate
	set indeterminate of progress bar to false
	«event PrBrStMn» progress bar
		--> error number -1708
Result:
error "SKProgressBar got an error: progress bar doesn't understand the «event PrBrStMn» message." number -1708 from progress bar*)

While the script was frozen and SKProgressBar was still running, I checked that its version was indeed 1.0.1.
So, I think that shows that v1.0.1 in a clean script, running on a clean volume is still crashing with a reproducible error.

Cheers, Chris

please replace

«event PrBrStMn» with start animation
«event PrBrIcRm» given «class bYVl»:10.0 with increment by 10
«event PrBrSpMn» with stop animation

That’s never going to solve the problem if the code you’re pasting contains the old codes. Either use the new codes, or just rewrite the commands to use the English commands (set current value, increment, etc).

Hi Stefan.

The changes are rather disastrous, since they break every script compiled against the previous version(s) of your app ” which is inconvenient for all your existing users, not just those who don’t know about compiled tokens.

In the past, when Apple or anyone wanted to change an event or class code, they might give the old code a new keyword ” say start animation (old) ” and allow it still to work. That way, existing scripts wouldn’t break and new ones would get the new token for the original keyword. Anyone seeing start animation (old) when opening an older script in their editor could simply delete the b[/b] and recompile the script to get the new token. I don’t know how feasible this is nowadays, but something like it should be considered.

Hi Nigel,

thanks for the suggestion, I did that, same link

Hi Shane,
What I copied was the absolute original code from v1.0 of my script, I had been using before I even heard of this progress bar app. Then, I modified my original code, by copy & pasting from Stefan’s script at the top of this page, so as to enclose the action I wanted to attach the bar to (i.e. the action is inserted between ‘start animation’ and the increment repeat block).

Unless, I really misunderstand what you are saying (and that’s a very distinct possibility), I think that what I’ve done is in fact equivalent to retyping the whole code. Please comment if you think I’m wrong,

Cheers, Chris

Many thanks Stefan,
The new version 1.0.1(3) works perfectly now in 10.8.2 :slight_smile:
May I suggest to update the link at #1 to always point to the latest version, to make it easier to find.

I had to update 13 instances of SKPB 1.0 code, but hey, the end result is great :cool:

Not so great was that I was about half through updates, busily retyping over the three commands, before I finally noticed Nigel’s suggestion :stuck_out_tongue:

Cheers,
Chris

No, that sounds right. But the old app’s terminology was being accessed somewhere…

At some point Stefan, I’m hoping there will be a link to disk image download with the latest application version, the read me document and a sample script that works without any editorial repairs. Without that, you’ll be deluged with emails when it doesn’t work for new users.

For now, the best bet is to go to post #1 and download SKProgressBar 1.0 which after unpacking is a dmg. Remove the Readme and Script files, but not the application and eject the dmg.

Then go to post #7 and download SKProgressBar 1.0.1. Now you can compile the script. In the script, you may find the word (old) in several places. Remove those and recompile. Now you’re good to go.

I know this is kinda old, but I just wanted to say thanks. This is awesome. I added it to an ancient script that I am updating and it saved me a ton of work.

I update the app to version 1.1 . It uses now ARC and is compatible from 10.7 to 10.11

SKProgressBar 1.1

Nice Stefan and timing couldn’t be better :cool:. I saw in some post people in doubt of using SKProgressIndicator solely based on the fact it hasn’t been updated in a while.

Actually that’s the reason why I updated it :wink:

Thanks for the update. It is very good to know that it is compatible with Yosemite and El Capitan.
Do you expect it to be compatible beyond 10.11?

May I suggest that you include the following in your zip file:

  • The demo script that you have at the top of this thread.
  • A demo that works with other apps
  • A ReadME that provides basic install and usage instructions

If I am going to use this, and distribute with my scripts, I don’t want to point the recipients to this thread, which could raise a lot of questions and cause confusion among users who just use AppleScripts, as opposed to develop them.

Thanks.

I’m seeing a number of commands in the scripting dictionary with “(old)”. There was some discussion above about removing these. So should these “(old)” commands be avoided?

Yes.

Stefan did not only changed names in updates but also AE code. So when an old script is re-opened with script editor and SKProgresssIndicator is updated meanwhile the user doesn’t see raw event code.