Re: Tell Finder Make New Folder wierdness!

From: David (davidmccabe@MAC.COM)
Date: Thu May 24 2001 - 14:29:34 AEST


That's cool. Would you be willing to let me add it to my utility library? I=
t
will be realesed under either the GPL or LGPL (I'm leaning toward the later
for now).
______
David McCabe
davidmccabe@mac.com
http://homepage.mac.com/davidmccabe/
God is good!=20


> set strPath to (((choose folder) as string) &
> "TestFolder:AnotherTestFolder:YetAnotherOne:") as string
> my sureFolder(strPath)
>=20
> on sureFolder(strPath)
>=20
> set oldSpaceChar to AppleScript's text item delimiters
> set AppleScript's text item delimiters to ":"
>=20
> tell application "Finder"
> if exists container strPath then
> set AppleScript's text item delimiters to oldSpaceChar
> return true
> else
> set strFolderPath to ""
> repeat with i from 1 to ((count (text items in strPath)) - 1)
> set strFolderPath to ((text items 1 through i of
> strPath) as string) & ":"
> if i =84 2 then set strParentFolder to ((text items 1
> through (i - 1) of strPath) as string) & ":"
> set strFolderName to text item i of strPath
> try
> alias strFolderPath
> on error
> make new folder at strParentFolder with
> properties {name:strFolderName}
> end try
> end repeat
> end if
> end tell
> set AppleScript's text item delimiters to oldSpaceChar
> return true
> end sureFolder
>=20

------------------------------



This archive was generated by hypermail 2b29 : Sun May 27 2001 - 12:00:29 AEST