folder action help
folder action help
- Subject: folder action help
- From: Adam Tabak <email@hidden>
- Date: Tue, 27 Feb 2001 16:08:35 -0500
Would someone please figure out why the following Folder Action isn't
working:
on opening folder (daFolder)
try
set oldId to AppleScript's text item delimiters
set AppleScript's text item delimiters to ":"
set fName to the last text item of (daFolder as string)
set fileName to "password-" & fName
set theAlias to "iBook HD:System Folder:Preferences:password:" &
fileName
set rNum to (open for access file theAlias with write permission)
set fileeof to (get eof rNum)
if fileeof < 1 then
set newpass to the text returned of (display dialog "Choose a
password for folder " & fName & ":" default answer "" buttons "OK" default
button 1)
write newpass to rNum
end if
set reqPass to the text returned of (display dialog "Enter password
to open folder " & fName & ":" default answer "" buttons "OK" default button
1)
set fileeof to (get eof rNum)
set realPass to (read rNum to fileeof)
if reqPass is not realPass then
display dialog "Wrong!" buttons "Oh poo" default button 1
tell application "Finder" to close window fName
end if
close access rNum
on error
display dialog the result buttons "OK"
end try
end opening folder
Thanks,
Atomm
http://www.spazum.net/