A newbie in need of help!

I kind of new to applescript, especially os X so here are a few questions:

¢How do I get my password gate to work??? I think it shuld work but I can’t find any way of fixing its bugs. I open the folder and…NOTHING HAPPENS! here’s the code:


property Pass_Char : "§" --Set to the pass folder prefix.

on opening folder this_folder
	set dis_fldr to list folder this_folder
	repeat with i from 1 to 10000
		set fldr to (item i of dis_fldr)
		if the first character of fldr is Pass_Char then
			exit repeat
		end if
	end repeat
	if the first character of fldr is not Pass_Char then
		display dialog "You have no pass folder!" buttons {"OK"}
		tell application "Finder"
			close window this_folder
		end tell
		return "user cancled"
	end if
	display dialog "This is the folder passgate; Select password type." buttons {"Normal", "Secure"}
	set button to the button returned of the result
	if button is normal then
		set boln to "false"
	else
		set boln to "true"
	end if
	repeat with i from 1 to 1000000
		if boln is false then
			display dialog "Please insert password:" default answer "Password" hidden answer "false" buttons {"Hide", "Cancel", "OK"} default button "Hide" cancel button "Cancel" with title "Password" with icon "stop"
			set button to the button returned of the result
			set pass to the text returned of the result
		else
			display dialog "Please insert password:" default answer "Password" hidden answer "true" buttons {"Cancel", "OK"} default button "OK" cancel button "Cancel" with title "Password" with icon "stop"
			set button to the button returned of the result
			set pass to the text returned of the result
		end if
		if button is "Hide" then
			display dialog "Password is hidden. You may type in THE REST of your password into the secure box below, or click 'all clear' to continue normally." default answer "" buttons {"Show", "OK"} default button "OK" with title "Hidden" with icon "caution" with hidden answer
			
			set button to the button returned of the result
			set pass2 to the text returned of the result
			set pass to "§" & pass & pass2
		end if
		if button is "OK" then
			
		else
			return "user cancled"
		end if
	end repeat
	if pass is not fldr then
		tell application "Finder"
			close window this_folder
			display alert "You may not view this folder!" message "Password incorrect." as "warning" buttons "OK" cancel button "OK" giving up after "10"
		end tell
	end if
end opening folder

(done)¢Also, I want applescript to make an alias of a folder. Not the applescript alias, but an icon with the text in italics that leads to the main folder. Can this be done?

If you bother to read this far, I am very gratefull. If you respond, thats even better. Thanks in advance, Fisto.

Well, the easy part is the alias:

--Make Alias
set btn to button returned of (display dialog "Alias to File or Folder?" buttons {"Cancel", "File", "Folder"})
if btn is "File" then
	set chosen to choose file
else if btn is "Folder" then
	set chosen to choose folder
else
	return
end if
tell application "Finder" to set theAlias to make new alias file at desktop to chosen
-- where theAlias is a variable pointing to it. You can leave "set theAlias to" if you don't need it.

More generally:

tell application “Finder” to set myAlias to make new alias file at (path to place) to (path to file or folder)

With respect to your script, I assume you’re saving this as a script in the Folder Actions folder of your Scripts folder and then attaching it to the folder in question as a folder action. True?

Yes, pretty mutch. The script worked fine on OS 9 with a few modifications. But, for all its good for, I saved it in a personal folder. Not the folder actions folder.

Thankyou for the alias help, It took me some time to get the path to work, but now its fine. It was part of my application chooser app. Rather than looking at the whole load of confusing apps, I only look at the ones I want.