make new folder in front most open window

Hi

Am I missing something.? I can’t seem to figure out how to make a folder inside the currently open finder window.

here is my attempt…


tell application "Finder"
	set this_window to target of window 1
	tell this_window to make new folder
end tell

Al that seems to happen is a new folder gets created on the desktop.

Thanks

Hi,

the at parameter is the location specifier of the make command.
If it’s not specified the folder will be created at the default location of the Finder “ the desktop folder.


tell application "Finder"
	set targetFolder to target of window 1
	make new folder at targetFolder
end tell

Perfect.

Thanks Stefan