Where is BP Progress Bar app?

Hi,
I have included the excellent BP Progress bar into a script that we use in our studio that trims a six digit job number from folders - handy to see the progress when there is a lot of folders.

My question is this. I have put the BP folder with the script and app in the resources folder in the app package, so that it is portable. When the script is run for the first time on a new machine, it always asks where the application is.

I have already included the lines:

		set ProgressBarapp to alias (my_path & "Contents:Resources:BP:BP Progress Bar.app")
		set ProgressBar to load script alias (my_path & "Contents:Resources:BP:BP Progress Bar Controller.scpt")

After a bit of jiggery pokery, I can get it to recognise the app, but would rather the user (or me) didn’t have that initial confusion.

Has anyone come across this, or overcome it? Is it an OS limitation?

Thanks

Ian

Hey Guys,

I use this at the beginning of my script and it seems to work.


-- Path to BP Progress Bar.app
set BPProgressBar to (path to resource "BP Progress Bar.app") as string

-- Makes sure the app in the bundle is found
tell application BPProgressBar
	activate
	quit
end tell

-- Path to the progress bar controller script
global ProgressBar
set ProgressBar to load script (path to resource "BP Progress Bar Controller.scpt")

Basically since it is an app it has to be launched the first time for the system to find it using a “tell application” statement, which is how it is called in the controller script. I guess this may be able to be put in the controller script so when calling “initialize ()” the script will implicitly launch the app in that bundle. Otherwise if using the progress bar app in different scripts could launch a copy of the app that actually resides in a different bundle, probably the first script you launched with the progress bar app in it.

Cheers,
MT

Thanks for your suggestions.

I can’t get either of your methods to work. Once the process has worked once, it seems the app has ‘registered’ itself, but if it has never run before, it asks for the app.

I just tested again by copying my script to a machine I had never run it on and it didn’t ask for the progress bar app. This works on Tiger and Leopard for me. Are you launching the script by double click or running the script from ScriptEditor? I think (path to resource ) only works at run time from the bundle. You can have the script open but have to launch like an app to test.

MT

I too would like to know if there is a stable way to have it always just work from within the bundle…I am in a similar situation and have ended up having to separately install BP Progress Bar first, which is almost making me consider not using it altogether (but I’m addicted to it now).

The script is saved as an application bundle. It was tested on various machines in the studio (all G5’s with Tiger) and all prompt for app the first time it is run (even with the silent launch before hand).

It’s not out of the question to go around and get each copy up and running, but it’s a pain.

I’ve run into this exact problem, and I think I have a pretty good solution.

Use the “open” command in terminal to open the program, then you can send it whatever commands you want-
eg-

do shell script "open ~/BP\\ Progress\\ Bar.app"

Hope this works as well for you as it did for me!

-Sam