Displaying text

I’m new to AppleScript, unfortunately. I would like my scripts to display a window with the text “Running…” as long as they are running. How do I accomplish that?

I’m not sure what you mean by this. Please elaborate…

Thank you for your interest!

I would like my scripts to display a text window that informs the user that the script is running. There is a display dialog option in AppleScript, but this won’t solve the problem. AppleScript would wait for the user to react to the dialog, not finish execution.

There are a few sharware programs that will let you add a “progress bar” to your scripts. And ‘jonn8’ has an example of a pseudo progress bar at…

http://macscripter.net/exchange/comments.php?id=216_0_1_0_C

A couple of the shareware solutions are Extra Suites 1.0 and 24U Appearance Osax 2.1
AppleScript Studio would work for this also.

Actually, for OS 9, 24U Appearance OSAX 1.3 is free.

Jon

Hi :slight_smile:

Another way consists in using the clipboard to show the script progress, here one small example:


--At first time
tell application "Finder" to open clipboard

--In your loop (for exemple)
repeat with Bcl from 1 to 50
	--Here your script
	
	--This is the decreasing progress
	tell application "Finder"
		activate
		set the clipboard to ("" & (50 - Bcl))
	end tell
end repeat

--At end
tell application "Finder" to close clipboard

Tested with Os 9 and AS 1.4 :wink:

Now that is a nifty idea.
Bravo.

It is nifty, but, unfortunately, it is OS 9 only. This is broken in OS X (see the Finder dictionary).

Jon

Yeah, bummer. :frowning:

I highly recommend David’s ‘Extra Suites’ for OS X.
I use it quite a bit with great success.
Kudos, David!

Very nifty indeed.

I got curious and saved a series of pict files of an animated progress bar. And instead of setting the clipboard to text set it to the pict file as a picture:

property sourceFolder : "Mac HD:Desktop Folder:progress:"

tell application "Finder" to open clipboard

repeat with Bcl from 100 to 0 by -1 --countdown from 100 to 1
	
	--using the number we are on, concat to get the path to the appropriate pict file
	set filePath to sourceFolder & Bcl & ".pct" as picture
	
	tell application "Finder"
		activate
		set the clipboard to filePath as picture
	end tell
end repeat

tell application "Finder" to close clipboard

I could only get it to work with PICT files saved from Photoshop and did not really save 100 pict files - I only tested it with 10, mostly cuz I’m lazy.

Thanks Fredo!

Hey folks,

Since we are talking 9, don’t forget about Dialog Director too! :wink:

As 24U Osax, DD has a very adequate Progress Bar as well.

Hi All :slight_smile:

Very interesting your use of the clipboard with images… very good idea !!!

For Os X, we can use and rename a simple folder in the desktop, for exemple :

--At first time 
tell application "Finder" to set NewDos to ¬
	(make new folder at desktop) as alias

--In your loop (for exemple) 
repeat with Bcl from 1 to 50
	--Here your script 
	
	--This is the decreasing progress 
	tell application "Finder"
		activate
		set name of NewDos to ("" & (50 - Bcl) & return)
		--with a "return" to avoid possible errors
	end tell
end repeat

--At end 
tell application "Finder" to delete NewDos

Attention, this easy way is very slow with Os9, but rather fast under OsX…
:wink: