Okay, I’m stuck. The script below runs fine on one G5 (OS X 10.3) but generates an error “Finder got an error: Can’t make a folder.” on another G5 (OS X 10.3.2).
Has there been some change in syntax for making a new folder that I’m not aware of? Or is something else going on? This thing is making me feel stupid.
tell application "Finder"
set destinationFolder to "Macintosh HD:" as alias
set completedTextFolder to "Macintosh HD:Completed Text:"
if (exists alias completedTextFolder) is false then
set theNewFolder to (make new folder at destinationFolder)
set name of theNewFolder to "Completed Text"
end if
end tell
Since this script is creating a folder at the root level of the hard drive, perhaps on the other G5 your account doesn’t have privs to modify the root level of the drive?
tell application "Finder"
set destinationFolder to "Macintosh HD:" as alias
try
set completedTextFolder to folder "Macintosh HD:Completed Text:"
on error
set completedTextFolder to make new folder at folder destinationFolder with properties {name:"Completed Text"}
end try
end tell
It probably is a permissions issue but perhaps it is a naming issue. Try this:
tell application "Finder"
set destinationFolder to (name of startup disk) as string
set completedTextFolderName to "Completed Text"
set completedTextFolder to (destinationFolder & ":" & completedTextFolderName & ":")
try
if (exists alias completedTextFolder) = false then (make new folder at folder destinationFolder with properties {name:completedTextFolderName})
on error the_error
activate
display dialog the_error buttons {"OK"} default button 1 with icon 0 giving up after 10
return the_error
end try
end tell