progress bar

this works. When the untitled folder appears, the progress bar disappears. What I would like is for the progress bar to go to 100%, then disappear. Cant figure out how to make that happen, I get an error that Finder needs permission.

It like the progress bar does not want to be inside the Tell Finder loop.

Any help would be appreciated.


set total_seconds to 100
set the_folder to (path to desktop as string) & "untitled folder" as string

set progress total steps to total_seconds
set progress description to "Script Progress"
set progress additional description to "Additional description"

repeat with i from 1 to total_seconds
	
	set progress completed steps to i
	delay 0.1
	
	tell application "Finder"
		if (exists folder the_folder) then
			delay 1
			exit repeat
		end if
	end tell
	
end repeat





figured it out. I made an app with XOJO that has in interface with buttons on it. Some buttons will mount a server at work and type your ID and PW for you. The code below should give the use a visual on the progress of the server being mounted. Hope this helps someone in a similar fashion.


set total_seconds to 100
set the_folder to (path to desktop as string) & "untitled folder" as string

set progress total steps to total_seconds
set progress description to "Script Progress"
set progress additional description to "Additional description"

repeat with i from 1 to total_seconds
	
	tell application "Finder"
		if (exists folder the_folder) then
			set i to 100
			delay 1
			--exit repeat
		end if
	end tell
	
	set progress completed steps to i
	
	if i is equal to 100 then
		delay 1
		exit repeat
	end if
	
	delay 0.1
	
end repeat